On 12 Sep 2002, Roland Roberts wrote:
> >>>>> "Andrew" == Andrew Perrin <clists@perrin.socsci.unc.edu> writes:
> ...
> Can you do this via a subselect:
>
> SELECT * FROM
> ( SELECT ... FROM participants
> WHERE typenr=1 AND <eligibility>
> UNION
> SELECT ... FROM participants
> WHERE typenr=2 LIMIT 172 )
> ORDER BY zip;
>
Unfortunately in this case the LIMIT is applied to the fully-UNIONed set,
limiting the total number of cases to 172 instead of just those from the
second subquery. Tom Lane's example worked, though.
Thanks,
Andy
----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu