Re: [SQL] Limit doesn't work with select unions

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Postgres <postgres(at)weblynk(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] Limit doesn't work with select unions
Date: 1999-10-25 09:02:50
Message-ID: Pine.GSO.3.96.SK.991025130114.21751K-100000@ra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-sql

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(at)weblynk(dot)com>
> To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgreSQL(dot)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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Postgres 1999-10-25 10:52:18 Vacuum takes more than 1 hr
Previous Message Postgres 1999-10-25 08:27:40 Limit doesn't work with select unions

Browse pgsql-sql by date

  From Date Subject
Next Message Postgres 1999-10-25 10:52:18 Vacuum takes more than 1 hr
Previous Message Peter Eisentraut 1999-10-25 08:52:34 Re: [SQL] possible bug?