mysql UNION question
Posted: Sat Oct 13, 2007 3:32 pm
my query:
#1) when i am getting the data using mysql_fetch_array, how can i tell which table the row is from?
#2) how can i get everything to order by `date` desc? like right now, that does order it by date desc, except it does the 1st table 1st, the 2nd table 2nd.
Code: Select all
SELECT * FROM `table1` UNION ALL SELECT * FROM `table2` ORDER BY `date` desc#2) how can i get everything to order by `date` desc? like right now, that does order it by date desc, except it does the 1st table 1st, the 2nd table 2nd.