Hi a have 4 tables

Table A
ID   |   Data 1
---------------
1    |    A
2    |    W
Table B
ID   |    Data 2
-----------------
1    |     B
1    |     C
2    |     X
Table C
ID   |   Data 3
----------------
1    |     D
1    |     E
1    |     F
Table D
ID   |    Data 4
----------------
1    |     G
1    |     H
2    |     Z

I want to have this result

Table Result
ID	|	Data 1	|	Data 2	|	Data 3	|	Data 4
-----------------------------------------------------------------------
1	|	A	|	B	|	D	|	G
	|      null	|	C	|	E	|	H
	|      null	|      null	|	F	|      null
2       |       W       |       X       |      null     |       Z

I tried different kind of join statement but i could not achieve my desired output.

Pls help.....

Recommended Answers

All 3 Replies

Which server are you using, because you cross-posted in MySQL and MSSQL ?

sorry for that im really using mysql server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.