Example:
Table 1:
Col1 Col2
----------- -------------
A 1
B 2
D 3
E 4
Table 2:
Col3 Col4
----------- -------------
A 7
E 9
Z 5
Table 3:
Col5 Col6
----------- -------------
Y 8
Expected output:
Col1 Col2 Col3 Col4 Col5 Col6
---- ---- ---- ---- ---- ----
A 1 A 7 Y 8
B 2 E 9 NULL NULL
D 3 Z 5 NULL NULL
E 4 NULL NULL NULL NULL
I want the output as shown in the picture.
If there are three tables with columns as Col11, Col2 and Col3, Col4 and Col5 and Col6 then expected output should be as Col1, Col2, Col3, Col4, Col5, Col6 without any joins. It should just Table2 is at right hand side of the Table1 And Table3 should be at right of the Table2. If number of rows don't match then Null values will consume the space. I know the solution for Two tables. But Need SQL query syntax for n number of tables. -Thanks in Advance.