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 |
rickystyx
Starting Member
4 Posts |
Posted - 2013-03-15 : 12:55:22
|
Any help will be appreciated.Two tables: "Events", "Users""Events" columns are: Timestamp, UserID_A, UserID_B"Users" columns are: UserID, UserNameI need to SELECT UserName_A and UserName_B from "Users" based on the UserID's in "Events". One column is easy enough, but I can't figure out how to join user information for multiple columns.Thanks in advance! |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-15 : 12:57:47
|
the hint is to link it twice each time based on different columnMake a try and post in case you face any issue------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rickystyx
Starting Member
4 Posts |
Posted - 2013-03-15 : 13:04:31
|
Looks like I figured it out. Thanks for the direction... it's much appreciated. Here's my query, with a few more details :)...select s.sessionid as 'SessionID', s.evtime as 'TransferTime', u1.displayname as 'TransferringAgent', u2.displayname as 'ReceivingAgent'from dbo.sessionevents s inner join dbo.users u1 on s.evid = u1.id inner join dbo.users u2 on s.evparam = u2.idwhere...Thanks again, visakh16 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-15 : 13:10:23
|
cool...welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|