Here is my table and data of these tables
Table name: Code
CID Code
1 abc
2 def
3 xyz
Table Name : Details
ID Date Value1 CID
1 1/1/2009 12 1
2 1/1/2009 25 2
3 1/1/2009 18 3
4 1/2/2009 36 1
5 1/2/2009 45 2
6 1/3/2009 19 1
Resultant Table:
Date Value1 CID Code
1/1/2009 12 1 abc
1/1/2009 25 2 def
1/1/2009 18 3 xyz
1/2/2009 36 1 abc
1/2/2009 45 2 def
1/2/2009 Null 3 xyz
1/3/2009 19 1 abc
1/3/2009 NUll 2 def
1/3/2009 Null 3 xyz
I need to get all record from the code table and against each code I have to get all the rows from the details table, if some code have value their need value and if not then Null
Thanks