Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by hub.org (8.9.3/8.9.3) with ESMTP id FAA02520 for ; Mon, 25 Oct 1999 05:04:26 -0400 (EDT) (envelope-from oleg@sai.msu.su) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.9.1/8.9.1) with SMTP id NAA19922; Mon, 25 Oct 1999 13:02:50 +0400 (MSD) Date: Mon, 25 Oct 1999 13:02:50 +0400 (MSD) From: Oleg Bartunov X-Sender: megera@ra To: Postgres cc: "pgsql-sql@postgresql.org" Subject: Re: [SQL] Limit doesn't work with select unions In-Reply-To: <071a01bf1ec2$ce0cd760$9befaace@usedcars.com> Message-ID: Organization: Sternberg Astronomical Institute (Moscow University) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 > To: "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