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 the

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

2005-02-25 Thread Robert Simpson
mail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [sqlite] SQL Help (Joining and Grouping) X-SmarterMail-Spam: SPF_Pass X-Rcpt-To: <[EMAIL PROTECTED]> Hello, I send this once some days ago,

[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 (id,n