Re: Use of the LIMIT clause ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Bayet <bayet(at)enseirb(dot)fr>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Use of the LIMIT clause ?
Date: 2001-03-12 23:26:19
Message-ID: 7612.984439579@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

Richard Bayet <bayet(at)enseirb(dot)fr> writes:
> I did knew about this, but the author goes further about the "limit
> N,P", which allows someone to get only results between the Nth and Pth
> lines of the whole result...

Is that actually how MySQL interprets two parameters? We treat them
as count and offset respectively, which definition I thought was the
same as MySQL's.

> I tried this with psql, but couldn't get anything but parse errors.

Works for me:

regression=# select unique1 from tenk1 limit 10;
unique1
---------
8800
1891
3420
9850
7164
8009
5057
6701
4321
3043
(10 rows)

regression=# select unique1 from tenk1 limit 3,5;
unique1
---------
8009
5057
6701
(3 rows)

regression=#

What PG version are you running?

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Alfonso Peniche 2001-03-13 00:16:27 Re: Postgresql \z grant question
Previous Message Dave Millen 2001-03-12 23:24:23 Re: Computer with Linux OS not shown on Computers with Windows OS

Browse pgsql-sql by date

  From Date Subject
Next Message Carl van Tast 2001-03-12 23:34:09 Re: default value syntax - pg compared to?
Previous Message Tom Lane 2001-03-12 23:21:40 Re: help