FULL OUTER JOIN with exclusion
(Aggrega i dati da due tabelle)
SELECT * FROM Table1 T1 FULL OUTER JOIN Table2 T2 ON T1.IdT2 = T2.IdT2 WHERE T1.IdT2 IS NULL OR T2.IdT2 IS NULL;
IdT1 | Name | IdT2 | IdT3 |
---|---|---|---|
1 | Mauro | 1 | (null) |
2 | Andrea | 3 | (null) |
3 | Marco | 2 | (null) |
4 | Franco | 1 | (null) |
5 | Giovanna | 7 | (null) |
6 | Francesca | 5 | 2 |
7 | Giulia | (null) | 1 |
8 | Mario | (null) | 3 |
IdT2 | Color |
---|---|
1 | Giallo |
2 | Verde |
3 | Rosso |
4 | Arancio |
5 | Grigio |
6 | Nero |
7 | Rosa |
8 | Blue |
9 | Azzurro |
IdT3 | Food |
---|---|
1 | Pizza |
2 | Carne |
3 | Pesce |
IdT1 | Name | IdT2 | IdT3 | IdT21 | Color |
---|---|---|---|---|---|
7 | Giulia | (null) | 1 | (null) | (null) |
8 | Mario | (null) | 3 | (null) | (null) |
(null) | (null) | (null) | (null) | 4 | Arancio |
(null) | (null) | (null) | (null) | 6 | Nero |
(null) | (null) | (null) | (null) | 8 | Blue |
(null) | (null) | (null) | (null) | 9 | Azzurro |