考虑我有一个查询
select * from A Except select * from B union all select * from B except select * from A
查询处理如下
select * from ( select * from A Except select * from B ) a union all ( select * from B Except select * from A ) b
如何在sql中定义处理顺序.在任何情况下它都会这样处理吗?
select * from A Except select * from ( select * from B union all select * from B ) a except select * from A
Sean Lange.. 5
EXCEPT和UNION"从左到右"处理.这意味着没有任何括号来确定它们将按照它们出现在sql中的顺序进行处理.
https://msdn.microsoft.com/en-us/library/ms188055.aspx
EXCEPT和UNION"从左到右"处理.这意味着没有任何括号来确定它们将按照它们出现在sql中的顺序进行处理.
https://msdn.microsoft.com/en-us/library/ms188055.aspx