pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Limit doesn't work with select unions
2+ messages / 2 participants
[nested] [flat]

* Limit doesn't work with select unions
@ 1999-10-25 08:27  Postgres <postgres@weblynk.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Postgres @ 1999-10-25 08:27 UTC (permalink / raw)
  To: pgsql-sql@postgresql.org <pgsql-sql@postgreSQL.org>

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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] Limit doesn't work with select unions
@ 1999-10-25 09:02  Oleg Bartunov <oleg@sai.msu.su>
  parent: Postgres <postgres@weblynk.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Oleg Bartunov @ 1999-10-25 09:02 UTC (permalink / raw)
  To: Postgres <postgres@weblynk.com>; +Cc: pgsql-sql@postgresql.org <pgsql-sql@postgreSQL.org>

It's fixed in current 6.5 sources. Wait for 6.5.3 or just
get REL6_5 tree from cvs

	Oleg

On Mon, 25 Oct 1999, Postgres wrote:

> Date: Mon, 25 Oct 1999 01:27:40 -0700
> From: Postgres <postgres@weblynk.com>
> To: "pgsql-sql@postgresql.org" <pgsql-sql@postgreSQL.org>
> Subject: [SQL] Limit doesn't work with select unions
> 
> 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
> 
> 
> 
> 
> ************
> 

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-10-25 09:02 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-10-25 08:27 Limit doesn't work with select unions Postgres <postgres@weblynk.com>
1999-10-25 09:02 ` Oleg Bartunov <oleg@sai.msu.su>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox