Forum Moderators: coopster
I need to sort the contents of two tables. PHP is the frontend and MySQL the backend.
I've read through MySQL's JOIN which did not produce the desired results.
Ideas welcome.
Table 1:
id name occupation
2 foobar manager
3 johnny CEO
Table2:
id name occupation
1 mike tech
5 foo doctor
Sorted Results of Table 1 and Table 2 Descending:
id name occupation
5 foo doctor
3 johnny CEO
2 foobar manager
1 mike tech
[edited by: HoboTraveler at 8:00 am (utc) on May 3, 2008]
(SELECT a FROM t1 WHERE a=10 AND B=1)
UNION
(SELECT a FROM t2 WHERE a=11 AND B=2)
ORDER BY a LIMIT 10;