Page 1 of 1

select from 3 tables order by date

Posted: Tue Oct 28, 2008 10:52 am
by itsmani1
Hi


I have three tables birthdays, events, holidays I want to fetch data from all three tables order by date. Can i do this? if i can what's the way?

Regards,

Re: select from 3 tables order by date

Posted: Tue Oct 28, 2008 11:01 am
by VladSun
By using UNION?
Also, use a constant column to distinguish records from the 3 tables, if you need to.
E.g.:
[sql]SELECT    1, .....FROM    table1unionSELECT    2, ....FROM    table2[/sql]