X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E185452811 for ; Tue, 17 May 2005 19:27:56 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18341-09 for ; Tue, 17 May 2005 22:27:53 +0000 (GMT) Received: from quasar.skima.is (quasar.skima.is [212.30.200.205]) by svr1.postgresql.org (Postfix) with ESMTP id 0E71452804 for ; Tue, 17 May 2005 19:27:52 -0300 (ADT) Received: from gnari ([85.220.28.44] [85.220.28.44]) by quasar.skima.is with ESMTP; Tue, 17 May 2005 22:27:54 Z Subject: Re: Does Postgresql have a similar pseudo-column "ROWNUM" as From: Ragnar =?ISO-8859-1?Q?Hafsta=F0?= To: PFC Cc: Alain , Sql-Postgre In-Reply-To: References: <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> Content-Type: text/plain Date: Tue, 17 May 2005 22:27:54 +0000 Message-Id: <1116368874.9362.14.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/144 X-Sequence-Number: 21457 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