Re:Relational Lookups (join confusion)
From: Ike (rxv_at_hotmail.com)
Date: 10/18/03
- Previous message: pratcp: "Re: MSSQL JDBC with J2SE 1.4.1 ??"
- Next in thread: Bjorn Abelli: "Re: Re:Relational Lookups (join confusion)"
- Reply: Bjorn Abelli: "Re: Re:Relational Lookups (join confusion)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 18 Oct 2003 02:16:54 GMT
Suppose I have tableA:
id associate1 associate2
1 1 2
2 1 3
And tableB
id associatename
1 jack white
2 bill brown
3 joe green
The values for tableA.associate1 and tableA.associate2 are keys into tableB
In wishing to display, say, the textual names (the associatenames in tableB)
for a given record in tableA then, I would have the following statement (or
so I believe!):
SELECT tableB.associatename, tableB.associatename from tableA,tableB where
tableA.associate1 = tableB.id and tableA.associate2 = tableB.id
Of course, this only returns a row when
tableA.associate1==tableA.associate2. Can someone please illuminate me as to
what I am missing here? Thanks, Ike
- Previous message: pratcp: "Re: MSSQL JDBC with J2SE 1.4.1 ??"
- Next in thread: Bjorn Abelli: "Re: Re:Relational Lookups (join confusion)"
- Reply: Bjorn Abelli: "Re: Re:Relational Lookups (join confusion)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|