JOIN confusion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ike

    #1

    JOIN confusion

    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.associat e1 and tableA.associat e2 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.associat ename, tableB.associat ename from tableA,tableB where
    tableA.associat e1 = tableB.id and tableA.associat e2 = tableB.id

    Of course, this only returns a row when
    tableA.associat e1==tableA.asso ciate2. Can someone please illuminate me as to
    what I am missing here? Thanks, Ike


Working...