Re: [SQL] Nested selects

2009-04-09 Thread Steve Midgley
pgsql-sql-ow...@postgresql.org wrote: Date: Tue, 7 Apr 2009 22:34:38 -0400 From: Glenn Maynard To: pgsql-sql@postgresql.org Subject: Nested selects Message-ID: I'm deriving high scores from two tables: one containing data for each time a user played (rounds), and one containing a list of stage

[SQL] Nested selects

2009-04-07 Thread Glenn Maynard
I'm deriving high scores from two tables: one containing data for each time a user played (rounds), and one containing a list of stages: CREATE TABLE stage (id SERIAL NOT NULL PRIMARY KEY, name VARCHAR); CREATE TABLE round (id SERIAL NOT NULL PRIMARY KEY, score REAL, stage_id INTEGER REFERENCES st