If I have 3 tables like the following:
Table A:
Item Start_QTY
A 100
B 100
Table B:
Item Purchase_QTY
A 10
C 20
Table C:
Item End_QTY
A 90
B 10
C 10
How do I join the 2 tables to get the following result:
Item Start_QTY Purchase_QTY End_QTY
A 100 10 90
B 100 NULL 10
C NULL 20 10
If I do the following:
Select COALESCE(a.item, b.item, c.item) as item, a.start_QTY, b.purchase_QTY, c.End_QTY from
A as a
full outer join
B as b
on a.item = b.item
full outer join
C as c
on a.item = c.item
I get the following:
A 100 10 90
B 100 NULL 10
C NULL 20 NULL
C NULL NULL 10