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 |
|
k00tje
Starting Member
2 Posts |
Posted - 2009-09-30 : 02:56:50
|
Hi All,I'm having an issue where i do have tables like this:Table1 userguid1 userguid2 userguid3Table2 guid displaynameIn table1 all columns display a guid and can differ.How can i replace the userguid with the displayname in my query ?It did cost me pretty much time so far trying with multiple joins, but couldn't figure out what i'm doing wrong. Probably a piece of cake for you guys.Thanks for reading |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-30 : 03:05:38
|
[code]selectt1.userguid1,g1.displayname,t1.userguid1,g2.displayname,t1.userguid1,g3.displaynamefrom Table1 t1left join Table2 g1 on t1.userguid1 = g1.guidleft join Table2 g2 on t1.userguid2 = g2.guidleft join Table2 g3 on t1.userguid3 = g3.guid[/code] No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
k00tje
Starting Member
2 Posts |
Posted - 2009-09-30 : 03:20:39
|
Wow, that did the trick.Thank you very much. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-30 : 03:25:09
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|