Let's say I have two SQL tables:
I would like to return the titles and indexes from both tables in a single query, having the results ordered alphabetically by the titles.
How can I accomplish this? I'm thinking with UNION but I can't quite get things to work.
SELECT title, id FROM
(SELECT title = t1_title, id = t1_id FROM table1
SELECT title = t2_title, id = t2_id FROM table2) X
ORDER BY title
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)