Received: from mail1.stofanet.dk (mail1.stofanet.dk [212.10.10.6]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id e9UNE7l07593 for ; Mon, 30 Oct 2000 18:14:07 -0500 (EST) (envelope-from martin@mail1.stofanet.dk) Received: (qmail 32346 invoked from network); 30 Oct 2000 23:14:03 -0000 Received: from pc77060.stofanet.dk (HELO fangorn.stofanet.dk) (mail@212.10.17.60) by mail1.stofanet.dk with SMTP; 30 Oct 2000 23:14:03 -0000 Received: from martin by fangorn.stofanet.dk with local (Exim 3.16 #1 (Debian)) id 13qN5L-0000VC-00; Mon, 30 Oct 2000 23:07:19 +0100 To: Jeff Hoffmann Cc: Nikolay Mijaylov , pgsql-sql@postgresql.org Subject: Re: fetching rows References: <39FDC5BC.43C5AE76@propertykey.com> From: Martin Christensen Date: 30 Oct 2000 23:07:19 +0100 In-Reply-To: Jeff Hoffmann's message of "Mon, 30 Oct 2000 13:02:20 -0600" Message-ID: <87d7gikmp4.fsf@fangorn.stofanet.dk> Lines: 17 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200010/19 X-Sequence-Number: 19 >>>>> "Jeff" == Jeff Hoffmann writes: Jeff> you can't do that with a cursor, but you can use they mysql-ism Jeff> called a limit clause. for example, to fetch rows 26-50 from Jeff> that query, you'd do: Jeff> select * from films limit 25,26; Jeff> or Jeff> select * from files limit 25 offset 26; Since there's no particular ordering of the output of such a query it is necessary to explicitly state an ordering key. Otherwise you'll quickly find that the phase of the moon has very significant influence on the produced results. :-) Especially in 7.*, as I understand it. Martin -- GPG public key: http://home1.stofanet.dk/factotum/gpgkey.txt