SyntaxFix
Write A Post
Hire A Developer
Questions
You don't really need to have parenthesis. You can sort directly:
SELECT *, 1 AS RN FROM TABLE_A UNION ALL SELECT *, 2 AS RN FROM TABLE_B ORDER BY RN, COLUMN_1