ORDER BY
suggest changeIf you need to sort the results of a UNION, use this pattern:
( SELECT ... )
UNION
( SELECT ... )
ORDER BY
Without the parentheses, the final ORDER BY would belong to the last SELECT.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents