Received: from thor.candleweb.no (thor.candleweb.no [195.139.160.194]) by hub.org (8.10.1/8.10.1) with ESMTP id e58DWTT15956 for ; Thu, 8 Jun 2000 09:32:30 -0400 (EDT) Received: (from gunnar@localhost) by thor.candleweb.no (8.10.0/8.10.0/on4) id ; Thu, 8 Jun 2000 15:13:24 +0200 (MET DST) To: "Cary O'Brien" Cc: mikeo@spectrumtelecorp.com (mikeo), pgsql-general@hub.org Subject: Re: Re: [SQL] oracle rownum equivalent? References: <200006081245.IAA05207@saltmine.radix.net> Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII From: Gunnar R|nning Date: 08 Jun 2000 15:13:23 +0200 In-Reply-To: "Cary O'Brien"'s message of "Thu, 8 Jun 2000 08:45:32 -0400 (EDT)" Message-ID: Lines: 29 X-Mailer: Gnus v5.4.65/Emacs 19.34 X-Archive-Number: 200006/238 "Cary O'Brien" writes: > Arrg. That's what I get for emailing late at night without checking > (my Oracle book is in the office). Where I typed rownum I meant > rowid. You are 100% correct about rownum. You can use rownum for > things like > > select * from foo where rownum <= 20 > > Where in postgresql you would say > > select * from foo limit 20 Related question: A typical web search interface needs a page based browsing system where you can list the 10 next matches. Is it possible to do this in PostgreSQL without retrieving all the rows up to your current page. I'm thinking of something like : select * from foo where and rownum >= 30 and rownum < 40 Or is this where I should look into using cursors to access the result set ? Regards, Gunnar