Limit doesn't work with select unions

Поиск
Список
Период
Сортировка
От Postgres
Тема Limit doesn't work with select unions
Дата
Msg-id 071a01bf1ec2$ce0cd760$9befaace@usedcars.com
обсуждение исходный текст
Ответы Re: [SQL] Limit doesn't work with select unions  (Oleg Bartunov <oleg@sai.msu.su>)
Список 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 по дате отправления:

Предыдущее
От: Dipankar Chakrabarti
Дата:
Сообщение: pg_dump for PGPLSQL
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [SQL] possible bug?