On 12 Sep 2002, Roland Roberts wrote:

> >>>>> "Andrew" == Andrew Perrin <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED] * andrew_perrin (at) unc.edu





---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to