Robert Simpson wrote: > SELECT games.id, team1_id, team2_id, a.name AS team1, b.name AS team2, result > FROM games > INNER JOIN teams AS a ON team1_id = a.id > INNER JOIN teams AS b ON team2_id = b.id > WHERE a.name LIKE 'Suns' AND b.name LIKE 'Bulls' > > That'll find all games where the Suns played the Bulls and you can use that > as an example of how you'd query for other things as well. >
Robert, excellent. That's exactly what I need. I didn't know that you could actually inner join the same table twice. That's quite powerfull. Thanke you Gilbert -- "The best portion of a good man's life is his little, nameless, unremembered acts of kindness and love." - Wordsworth, William