Limit doesn't work with select unions - Mailing list pgsql-sql

From Postgres
Subject Limit doesn't work with select unions
Date
Msg-id 071a01bf1ec2$ce0cd760$9befaace@usedcars.com
Whole thread Raw
Responses Re: [SQL] Limit doesn't work with select unions  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-sql
I'm doing the following query:
select a.id, cfs.id from cfs where a.id = cfs.oid union select b.id, cfs.id
from cfs where b.id = cfs.oid limit 1;
The limit basically doesn't work. I get the maximum amount of rows back.
I try the query
select a.id, cfs.id from cfs where a.id = cfs.oid limit 1 union select b.id,
cfs.id from cfs where b.id = cfs.oid limit 1;
and psql says the syntax is incorrect. Any ideas on how to use limit with
union queries?
Thanks,
Rich





pgsql-sql by date:

Previous
From: Dipankar Chakrabarti
Date:
Subject: pg_dump for PGPLSQL
Next
From: Peter Eisentraut
Date:
Subject: Re: [SQL] possible bug?