How would I sort ascending by my "name" column in my UNION ALL query? The "name" column is the third column in (if that matters)
My current SQL is:
SELECT * FROM 2019
UNION ALL
SELECT * FROM 2018;
How would I sort ascending by my "name" column in my UNION ALL query? The "name" column is the third column in (if that matters)
My current SQL is:
SELECT * FROM 2019
UNION ALL
SELECT * FROM 2018;
you need another query
1. the Union query, qnUnion
2. sort the query
select * from qnUnion order by [NAME]
Run Q2.
Or your query can be rewritten to:
SELECT * FROM (SELECT * FROM 2019 UNION ALL SELECT * FROM 2018) as tbl1 ORDER BY [Name]
Have you tried
SELECT * FROM 2019
UNION ALL
SELECT * FROM 2018
ORDER BY [Name]
or by position
SELECT * FROM 2019
UNION ALL
SELECT * FROM 2018
ORDER BY 3