Received: from www.propertykey.com (propertykey.com [206.196.37.193]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id e9UJ3FC46871 for ; Mon, 30 Oct 2000 14:03:15 -0500 (EST) (envelope-from jeff@propertykey.com) Received: from propertykey.com (gotojail.propertykey.com [206.196.37.197]) by www.propertykey.com (8.9.3/8.9.3) with ESMTP id NAA27984; Mon, 30 Oct 2000 13:02:55 -0600 Message-ID: <39FDC5BC.43C5AE76@propertykey.com> Date: Mon, 30 Oct 2000 13:02:20 -0600 From: Jeff Hoffmann Organization: PropertyKey.com X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Nikolay Mijaylov CC: pgsql-sql@postgresql.org Subject: Re: fetching rows References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/18 X-Sequence-Number: 18 Nikolay Mijaylov wrote: > > Let say we have a select that returns 100 rows. > > I can fetch first 25 with simple sql: > > BEGIN WORK; > DECLARE liahona CURSOR FOR SELECT * FROM films; > FETCH [FORWARD] 25 IN liahona; > CLOSE liahona; > COMMIT WORK; > > but how I can fetch rows from 26 to 50? I mean withou fetching first 25. Or > can I skip first 25? you can't do that with a cursor, but you can use they mysql-ism called a limit clause. for example, to fetch rows 26-50 from that query, you'd do: select * from films limit 25,26; or select * from files limit 25 offset 26; -- Jeff Hoffmann PropertyKey.com