Forum Moderators: open
I have a table with User information (id and name)
USER [userID, userName]
-----------------------
1 ¦ Bob
2 ¦ Jim
3 ¦ Ace
I have another table where the userID is used as a FK more than once
PROJECT [projID, pSponsor, pKeyContact]
---------------------------------------
1 ¦ 3 ¦ 1
2 ¦ 2 ¦ 1
So for Project #1, Ace is the Sponsor, Bob is Key Contact
For Project #2, Jim is the Sponsor, Bob is the Key Contact
The thing I can't figure out, is how to write a query that displays the PROJECT table but replaces the FK id # with userName from the user table
so the finished product would look like
QUERY RESULTS
------------------------
1 ¦ Ace ¦ Bob
2 ¦ Jim ¦ Bob
Any help is greatly appreciated as I'm feeling slightly moronic right now for now knowing how to do this
-Mike
Thank you for your help. That certainly solves the problem that I had asked.
(of course there is always a however)
However,
What do I do if one of the columns is optional (lets say Key Contact for the sake of the example). Now, if Key Contact is null but Sponsor has a value, my query won't return that row.
Again, I appreciate the first round of help and realize that this is basically a completely different question.
-Mike