par
yann18 » 23 oct. 2013, 14:22
en fait c'est l'union de 2 jointures externes:
sous mysql:
SELECT table1.date,table1.entree,table1.sortie,table2.champ FROM table1 LEFT JOIN table2 ON table1.date=table2.date
UNION
SELECT table2.date,table1.entree,table1.sortie,table2.champ FROM table2 LEFT JOIN table1 ON table1.date=table2.date;
ou encore avec la directive FULL OUTER JOIN de SQL2 (non supportée par mysql ) sous oracle:
SELECT table1.date,table1.entree,table1.sortie,table2.champ FROM table1 FULL OUTER JOIN table2 ON table1.date=table2.date
en fait c'est l'union de 2 jointures externes:
sous mysql:
[sql]
SELECT table1.date,table1.entree,table1.sortie,table2.champ FROM table1 LEFT JOIN table2 ON table1.date=table2.date
UNION
SELECT table2.date,table1.entree,table1.sortie,table2.champ FROM table2 LEFT JOIN table1 ON table1.date=table2.date;
[/sql]
ou encore avec la directive FULL OUTER JOIN de SQL2 (non supportée par mysql ) sous oracle:
[sql]
SELECT table1.date,table1.entree,table1.sortie,table2.champ FROM table1 FULL OUTER JOIN table2 ON table1.date=table2.date
[/sql]