是否可以将两个Except子句合并为一个结果集?
这行不通,但是本质上是我想要实现的目标
SELECT * FROM dbo.TemptblSHAREVendors EXCEPT SELECT * FROM dbo.tblSHAREVendors
UNION
SELECT * FROM dbo.tblSHAREVendors EXCEPT SELECT * FROM dbo.TemptblSHAREVendors
答案 0 :(得分:2)
您可以使用括号强制执行操作的优先级。
(SELECT *
FROM dbo.TemptblSHAREVendors
EXCEPT
SELECT *
FROM dbo.tblSHAREVendors)
UNION
(SELECT *
FROM dbo.tblSHAREVendors
EXCEPT
SELECT *
FROM dbo.TemptblSHAREVendors);