gpt4 book ai didi

c# - 从多个表中选择 MAX

转载 作者:太空宇宙 更新时间:2023-11-03 20:32:01 24 4
gpt4 key购买 nike

我有四个表,每个表中都有一个日期列。我正在尝试获取这四个日期列的最大日期。

    DateTime maxDate = ((from stockIn in db.StockIns select stockIn.StockInDate)
.Union(from stockOut in db.StockOuts select stockOut.StockOutDate)
.Union(from stockC in db.StockClearances select stockC.StockClearanceDate)
.Union(from stockR in db.StockRejections select stockR.StockRejectionDate))
.Max().Value;

这是最简单的方法吗?

提前致谢

最佳答案

如果这就是您的数据存储方式,那就很简单了。

关于c# - 从多个表中选择 MAX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7065032/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com