From: Oleg Bartunov <oleg@sai.msu.su>
To: Frank Morton <fmorton@base2inc.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] setting select limit?
Date: Thu, 11 Feb 1999 05:10:06 +0300 (MSK)
Message-ID: <Pine.GSO.3.96.SK.990211050723.9050E-100000@ra> (raw)
In-Reply-To: <01ae01be555f$0390d4f0$8355e5ce@base2inc.com>
You need v6.4.2-feature-patch which implement LIMIT option:
LIMIT This is a new option to the SELECT statement, telling
the database that only some of the rows selected
should be returned in the result set.
The added syntax of the LIMIT option is:
SELECT ... [LIMIT {ALL | lim} [, off]];
or
SELECT ... [LIMIT {ALL | lim}] [OFFSET off];
where lim is a positive integer value greater than
zero and off is an integer value greater or equal to
zero. Both values can be specified as Parameters when
using the server programming interface (SPI). In this
case, a zero value given in the argument for the lim
parameter means ALL.
You can find it in patches directory
Regards,
Oleg
On Wed, 10 Feb 1999, Frank Morton wrote:
> Date: Wed, 10 Feb 1999 20:36:57 -0500
> From: Frank Morton <fmorton@base2inc.com>
> To: pgsql-sql@postgreSQL.org
> Subject: [SQL] setting select limit?
>
> If a select is going to match 1000 records, but I only want to
> select the first 25, I thought I could:
>
> select * from table limit 25;
>
> But I guess I can't. How do I limit the query? I've search
> around with no results. Thanks.
>
>
>
>
_____________________________________________________________
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: oleg@sai.msu.su, fmorton@base2inc.com
Subject: Re: [SQL] setting select limit?
In-Reply-To: <Pine.GSO.3.96.SK.990211050723.9050E-100000@ra>
References: <01ae01be555f$0390d4f0$8355e5ce@base2inc.com> <Pine.GSO.3.96.SK.990211050723.9050E-100000@ra>
* 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