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

From Alex Satrapa
Subject Re: offset for query result ??
Date
Msg-id 3FB960DA.6090604@lintelsys.com.au
Whole thread Raw
In response to offset for query result ??  (Kathy Zhu <Kathy.Zhu@Sun.COM>)
List pgsql-general
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.

> Select * from Test offset 10, limit 4;

As per the PostgreSQL documentation, specifically the page on the
"SELECT" SQL command:

LIMIT Clause


    LIMIT { count | ALL }
     OFFSET start


  where count specifies the maximum number of rows to return, and start
specifies the number of rows to skip before starting to return rows.



so the query you want is:

SELECT * FROM Test LIMIT 4 OFFSET 10;

Alex


pgsql-general by date:

Previous
From:
Date:
Subject: Re: PostgreSQL v7.4 Released
Next
From: Reece Hart
Date:
Subject: Re: PostgreSQL v7.4 Released