Hi,
I have a query with 3 unions and I want to order the first two unions using one ORDER BY and the last union with a different ORDER BY. Unfortunately I am unable to group the first two selects with the first ORDER BY with parentheses without getting an error.
ex:
(SELECT a,b FROM table1)
UNION
(SELECT c,d FROM table2)
ORDER BY a,d
UNION
SELECT x,y FROM table3
ORDER BY y
Thanks