Re: [sqlite] SQL Help (Joining and Grouping)

2005-02-25 Thread Gilbert Jeiziner
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

[sqlite] SQL Help (Joining and Grouping)

2005-02-25 Thread Gilbert Jeiziner
Hello, I send this once some days ago, but it didn't appear on the list, so i hope this time it'll work out. I know this is not directly related to SQLite, but hopefully someone has the time to help me with a (probably) basic SQL question: Consider the following tables: CREATE TABLE teams