pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Postgres <postgres@weblynk.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgreSQL.org>
Subject: Limit doesn't work with select unions
Date: Mon, 25 Oct 1999 01:27:40 -0700
Message-ID: <071a01bf1ec2$ce0cd760$9befaace@usedcars.com> (raw)
References: <38123272.955C19B9@OConnor.net>
	<3813AC47.81F5F5C5@home.com>

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






view thread (2+ messages)  latest in thread

Message-ID: <071a01bf1ec2$ce0cd760$9befaace@usedcars.com>
Permalink:  ../071a01bf1ec2$ce0cd760$9befaace@usedcars.com/
Also on:    postgresql.org/message-id/071a01bf1ec2$ce0cd760$9befaace@usedcars.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: postgres@weblynk.com, pgsql-sql@postgreSQL.org
  Subject: Re: Limit doesn't work with select unions
  In-Reply-To: <071a01bf1ec2$ce0cd760$9befaace@usedcars.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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