Consider the following query:
SELECT statement_1 UNION SELECT statement_2 EXCEPT SELECT statement_3 INTERSECT SELECT statement_4;
The operations are performed in the following order:
- Intersect the results of statement_3 and statement_4.
- Union the results of statement_1 and statement_2.
- Subtract the intersected rows from the union.