Re: Use of the LIMIT clause ? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Use of the LIMIT clause ?
Date
Msg-id 7612.984439579@sss.pgh.pa.us
Whole thread Raw
In response to Use of the LIMIT clause ?  (Richard Bayet <bayet@enseirb.fr>)
List pgsql-admin
Richard Bayet <bayet@enseirb.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

pgsql-admin by date:

Previous
From: Grant
Date:
Subject: Re: Authentication by password
Next
From: Dave Millen
Date:
Subject: Re: Computer with Linux OS not shown on Computers with Windows OS