Re: offset for query result ??

From: Troels Arvin <troels(at)arvin(dot)dk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: offset for query result ??
Date: 2003-11-17 23:25:36
Message-ID: pan.2003.11.17.23.25.36.351685@arvin.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2003-11-17 23:35:13 Re: PostgreSQL v7.4 Released
Previous Message Kathy Zhu 2003-11-17 23:17:20 offset for query result ??