Neexistuje žádné FULL OUTER JOIN
v MySQL. Viz 7.2.12. Zjednodušení vnějšího spojení
a 12.2.8.1. Syntaxe JOIN
:
Můžete emulovat
FULL OUTER JOIN
usingUNION (od MySQL 4.0.0 dále):se dvěma tabulkami t1, t2:
SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id UNION SELECT * FROM t1 RIGHT JOIN t2 ON t1.id = t2.id
se třemi tabulkami t1, t2, t3:
SELECT * FROM t1 LEFT JOIN t2 ON t1.id = t2.id LEFT JOIN t3 ON t2.id = t3.id UNION SELECT * FROM t1 RIGHT JOIN t2 ON t1.id = t2.id LEFT JOIN t3 ON t2.id = t3.id UNION SELECT * FROM t1 RIGHT JOIN t2 ON t1.id = t2.id RIGHT JOIN t3 ON t2.id = t3.id