Below is the data set
Table1
col1,col2
key1,k1
key2,k2
key3,k3
Table2
col1,col3
key1,k11
key2,k22
key4,k44
Table3
col1,col4
key1,k111
key2,k222
key5,k555
I need to join the 3 tables based on col1. Below is my query
select a.col1,a.col2,b.col3,c.col4 from table1 a full outer join table2 b full outer join table3 c;
The expected output is shown below
Expected output:
col1,col2,col3,col4
key1,k1,k11,k111
key2,k2,k22,k222
key3,k3, ,
key4, ,k44,
key5, , ,k555
table1.col1 = table2.col1 and table1.col1 = table3.col1? - Andrew