Results 1 to 3 of 3
Thread: Select across similar tables
May 19, 2003, 02:40 #1
- Join Date
- May 2003
- 0 Post(s)
- 0 Thread(s)
Select across similar tables
maybe because it's monday, but i'm banging my head against the wall trying to get this to work.
I've got 5 tables, each table has a timestamp field (called datetime) and a message field, all i want to do is pull out the last entry that was added from all the tables put together.
I thought something like this would work:
SELECT date_format(datetime, '%D %M %Y %H:%i') as datetime,message FROM (table1,table2,table3,table4,table5,) ORDER BY datetime DESC LIMIT 1
If anyone's got any examples it would be greatly appreciated.