I have three tables which contain an id column. I would like to join these three tables together to produce a single table which has the ids and their corresponding matches. E.g. table A:
id_A |
---|
1 |
2 |
4 |
table B:
id_B |
---|
1 |
2 |
3 |
table C:
id_C |
---|
1 |
3 |
4 |
Would produce:
id_A | id_B | id_C |
---|---|---|
1 | 1 | 1 |
2 | 2 | |
4 | 4 | |
3 | 3 |
I currently am using a full outer join:
SELECT * FROM A
FULL OUTER JOIN B ON id_A = id_B
FULL OUTER JOIN C ON id_A = id_C
But this means that table C would not join on anything in that is not in table A but is in table B, e.g. we end up with:
id_A | id_B | id_C |
---|---|---|
1 | 1 | 1 |
2 | 2 | |
4 | 4 | |
3 | ||
3 |