Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mailtosaja
Starting Member
28 Posts |
Posted - 2008-08-11 : 03:43:47
|
| Hi, I have three table.structure and data display below..Test1TaskID R1 U1 U21 1202 41 null2 1203 null 46 3 1204 null 47U1_TableU1 name41 TestU2_TableU2 Name46 function147 function2i want the below structure data for the resourceIDTaskID ResourceID U1 U21 1202 Test --2 1203 -- function13 1204 -- function2Thanks in advance........Thanks & Regards,S.Sajan. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-11 : 03:47:00
|
| [code]SELECT t1.TaskID,t1.R1 AS ResourceID,ISNULL(u1.name,'-') AS U1,ISNULL(u2.name,'-') AS U2FROM Test1 t1LEFT JOIN U1_Table u1ON u1.U1=t1.U1LEFT JOIN U2_Table u2ON u2.U2=t1.U2[/code] |
 |
|
|
mailtosaja
Starting Member
28 Posts |
Posted - 2008-08-11 : 04:11:06
|
| thanks visakh16 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-11 : 04:13:34
|
quote: Originally posted by mailtosaja thanks visakh16
you're welcome . learn about joins http://www.sqlteam.com/article/writing-outer-joins-in-t-sql |
 |
|
|
|
|
|