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 |
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2005-09-30 : 11:48:04
|
| I have 3 basic tables joined like this and there are many responses in tblResponses related to each original request in tblRequests. When a new response is added in tblResponses, I insert the UserID (int) value in tblResponses. When a want to display the user's name associated with that response (not the UserID), how do I do this? This statement below gives me the name in the original request in tblRequests and I want the user's name in tblResponses. Sorry if this is confusing...Thanks.SELECT tblUsers.name, tblResponses.response, tblResponses.IDFROM tblRequests INNER JOINtblResponses ON tblRequests.ReqID=tblResponses.ReqID INNER JOINtblUsers ON tblRequests.UserID=tblUsers.UserIDWHERE tblResponses.ReqID=1tblUsers_________NameUserIDtblRequests___________ReqIDUserIDtblResponses______________ReqIDUserIDResponse |
|
|
mmarovic
Aged Yak Warrior
518 Posts |
Posted - 2005-09-30 : 12:08:15
|
| [code]SELECT tblUsers.name, tblResponses.response, tblResponses.IDFROM tblRequests INNER JOINtblResponses ON tblRequests.ReqID=tblResponses.ReqID INNER JOINtblUsers ON tblResponses.UserID=tblUsers.UserIDWHERE tblResponses.ReqID=1[/code]That's elementary, i think you rushed to much to post the question on the forum. Fortunatelly it's Friday. |
 |
|
|
evanburen
Posting Yak Master
167 Posts |
Posted - 2005-09-30 : 12:30:40
|
Now that I see the answer, I think you're right Thanks. |
 |
|
|
|
|
|