pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ragnar Hafstaư <gnari@simnet.is>
To: PFC <lists@boutiquenumerique.com>
Cc: Alain <alainm@pobox.com>
Cc: Sql-Postgre <pgsql-sql@postgresql.org>
Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
Date: Tue, 17 May 2005 22:27:54 +0000
Message-ID: <1116368874.9362.14.camel@localhost.localdomain> (raw)
In-Reply-To: <op.sqxxc81sth1vuj@localhost>
References: <DCD4903594CCF34CAFE200BDF3448D8D5B291A@tshuscodenmbx01.ERF.THOMSON.COM>
	<1116367382.9362.11.camel@localhost.localdomain>
	<428A3B54.4070902@pobox.com>
	<1116353539.26520.5.camel@localhost.localdomain>
	<428A2E81.2060501@pobox.com>
	<20050517170636.GC12405@phlogiston.dyndns.org>
	<op.sqxxc81sth1vuj@localhost>

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





view thread (17+ messages)  latest in thread

Message-ID: <1116368874.9362.14.camel@localhost.localdomain>
Permalink:  ../1116368874.9362.14.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1116368874.9362.14.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gnari@simnet.is, lists@boutiquenumerique.com, alainm@pobox.com
  Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as
  In-Reply-To: <1116368874.9362.14.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox