Selecting not joined data from several tables in MySQL -
i have several mysql tables same structure. have date field. have build 1 list in php shows rows in these tables, ordered date. rows mixed in list, criterium ordering date.
for instance:
table1.name; 2011-4-11 05:45h table6.name; 2011-4-11 10:30h table3.name; 2011-4-11 15:45h table2.name; 2011-4-16 09:30h is possible doing these using mysql query or have make 1 select per table , mix data php? there aren't joined tables, equal tables , have show data.
p.s.: can't make 1 unique table , add type field, have being asked keep tables are.
well, arguably can sort of.
select 'table1' name, mydate table1 union (select 'table2' name, mydate table2) tmp ... order mydate union works assuming same structure, eg in case name, date, , appends them 1 list , can sort them
Comments
Post a Comment