如何根据同一个表找到两个select语句之间的差异?例如:
SELECT ID
FROM Table as TableA
WHERE Date = '2016-04-30'
根据上面的选择声明,我想找到所有不存在的ID:
SELECT ID
FROM Table as TableB
WHERE Date = '2016-03-31'
答案 0 :(得分:1)
{{1}}
答案 1 :(得分:1)
早期的答案很聪明。这是一种简单的方法。
Select ID from Table
where Date = '2016-04-30'
and ID not in (select ID from Table where Date = '2016-03-31')