Skip site navigation (1) Skip section navigation (2)

Re: Does Postgresql have a similar pseudo-column "ROWNUM" as

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: PFC <lists(at)boutiquenumerique(dot)com>
Cc: Alain <alainm(at)pobox(dot)com>, Sql-Postgre <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
Date: 2005-05-17 22:27:54
Message-ID: 1116368874.9362.14.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-phppgsql-sql
On Wed, 2005-05-18 at 00:13 +0200, PFC wrote:
> > your subsequent selects are
> > select ... from tab WHERE skey>skey_last
> >                        OR (skey=skey_last AND pkey>pkey_last)
> >                     ORDER BY skey,pkey
> >                     LIMIT 100 OFFSET 100;
> 
> 	why offset ?
> 	you should be able to use the skey, pkey values of the last row on the  
> page to show the next page, no need for offset then.

of course you are right. the WHERE clause is supposed to replace
the OFFSET. too much cut and pasting without thinking and testing.

gnari



In response to

pgsql-php by date

Next:From: AlainDate: 2005-05-18 02:16:09
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
Previous:From: PFCDate: 2005-05-17 22:13:46
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as

pgsql-sql by date

Next:From: AlainDate: 2005-05-18 02:16:09
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
Previous:From: PFCDate: 2005-05-17 22:13:46
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group