Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

join to populate two key field

Status
Not open for further replies.

jtsaint

IS-IT--Management
Feb 10, 2003
3
GB
this is probablt easy but i am stuck

table1

UserID, Name, Pass
1 jam pas
2 and pas2

table2

Location, User1, User2
strat 1 2
birm 2 1


Thanks for any help


User1 and User2 in tabele2 are supposed to relate to userID
in table2. How do I set this up (is there a special way to set up a relationship) but more importantly what SQL command would give me this table as a result

Location, User1Name, User2Name,
strat jam and
birm and jam
 
select location,u1.name,u2.name
from table1 u1 , table2, table1 u2
where u1.userid = table2.user1
and table2.user2 = u2.userid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top