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 |
|
vidhya
Posting Yak Master
108 Posts |
Posted - 2008-10-01 : 13:05:38
|
| Hi Friends,I had two tables User and Request Table.User Table has UserId and UserNameRequest Table as UserId and ReporterIdI need to get Two UserName ,One for the UserId and other for the ReporterId How can I get id ? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-01 : 13:08:53
|
use User table twiceSELECT u1.UserName AS User,u2.UserName AS ReporterFROM Request rJOIN User u1ON u1.UserId=r.UserIdJOIN User u2ON u2.UserId=r.ReporterId |
 |
|
|
|
|
|