📜  sql 从 3 个表格中获取最高日期 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:26.362000             🧑  作者: Mango

代码示例1
SELECT MAX(MaxDate) FROM (SELECT MAX(TradeDate) AS MaxDate FROM Office.Transactions WHERE BrokerID = 1 AND TradeDate IS NOT NULLUNIONSELECT MAX(EntryDate) AS MaxDate FROM Office.IOI WHERE BrokerID = 1UNIONSELECT MAX(EntryDate) AS MaxDate FROM Office.TradeNotes WHERE BrokerID = 1) AS X