[vox-tech] SQL help - unions
Rod Roark
rod at sunsetsystems.com
Tue Jul 20 17:25:43 PDT 2004
On Tuesday 20 July 2004 05:03 pm, Henry House wrote:
...
> A subquery is an easy and fairly intuitive way to do this.
>
> SELECT * from (
> SELECT SSN from [Fall 2003]
> UNION
> SELECT SSN from [Spring 2004]
> ) WHERE race = 1;
Or to just get the headcount, use "select count(*)" instead
of "select *".
...
> It would be helpful to know what RDBMS (PostgreSQL, MySQL, ...) you are
> using since they vary greatly in their SQL syntax and feature support.
What he said. Personally I'm a big fan of PostgreSQL.
-- Rod
More information about the vox-tech
mailing list