Description
Currently the set operations INTERSECT, UNION and EXCEPT are assigned the same precedence. We need to change to make sure INTERSECT is given higher precedence than UNION and EXCEPT. UNION and EXCEPT should be evaluated in the order they appear in the query from left to right.
Given this will result in a change in behavior, we need to keep it under a config.
Here is a reference :
https://docs.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-except-and-intersect-transact-sql?view=sql-server-2017