Re: offset for query result ?? - Mailing list pgsql-general

From Troels Arvin
Subject Re: offset for query result ??
Date
Msg-id pan.2003.11.17.23.25.36.351685@arvin.dk
Whole thread Raw
In response to pg_constraint missing many entries?  (Jeff Boes <jboes@nexcerpt.com>)
List pgsql-general
On Mon, 17 Nov 2003 16:17:20 -0700, Kathy Zhu wrote:

> I know we have LIMIT to limit the number of rows returned, I wonder if
> there is a way to indicate an offset.
>
> e.g.
>
> Select * from Test offset 10, limit 4;

Make that

SELECT *
FROM Test
LIMIT 4 OFFSET 10;

> retrieve all Test, return 4 rows from the 10th row

Almost. In PostgreSQL, OFFSET x means skip the first x rows. See also
http://www.postgresql.org/docs/7.4/static/sql-select.html#SQL-LIMIT

--
Greetings from Troels Arvin, Copenhagen, Denmark


pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Better Unilization of Memory
Next
From: Shridhar Daithankar
Date:
Subject: Re: Move a table to another schema