Discuss Sort multiple tables as one (Join but not really) in the MySQL Help forum on Dev Shed. Sort multiple tables as one (Join but not really) MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
Posts: 26,380
Time spent in forums: 3 Months 1 Week 2 Days 7 h 54 m 8 sec
Reputation Power: 4140
Code:
SELECT Link
, Entry1
, Entry2
, NULL AS Entry3
, NULL AS Entry4
, NULL AS Entry5
, NULL AS Entry6
FROM table1
UNION ALL
SELECT Link
, NULL
, NULL
, Entry3
, Entry4
, NULL
, NULL
FROM table2
UNION ALL
SELECT Link
, NULL
, NULL
, NULL
, NULL
, Entry5
, Entry6
FROM table3