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 |
|
agarwasa2008
Posting Yak Master
109 Posts |
Posted - 2009-09-04 : 17:35:58
|
| I have 3 tables:Table1 - someName and complete productIDsTable2 - Name and productIDTable3 - DifferentName and productIDTable2 and table3 have some common and some unique ids. For exTable2======1234567 Chair 0987654 TableTable3======1234567 cushions5555555 DeskTable1======1234567 item10987654 item235555555 item45Result set==========1234567 Chair cushions item10987654 Table NULL item235555555 Null Desk item45Any inputs would be greatly appreciated.Thanks,SA |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-04 : 17:44:59
|
select t1.productid,t2.productname,t3.productname,t1.productnamefrom table1 t1left join table2 t2 on t2.productid = t1.productidleft join table3 t3 on t3.productid = t1.productid No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
agarwasa2008
Posting Yak Master
109 Posts |
Posted - 2009-09-04 : 19:21:19
|
| whats the difference between using left join and left outer joinThanks, for the prompt response.SA |
 |
|
|
singularity
Posting Yak Master
153 Posts |
Posted - 2009-09-04 : 19:29:22
|
| There is no difference. |
 |
|
|
agarwasa2008
Posting Yak Master
109 Posts |
Posted - 2009-09-04 : 19:59:14
|
| Thank you!!SA |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-05 : 05:44:11
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|