Received: from ether.adept.co.za (ether.adept.co.za [196.25.67.7]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAIJWWs48587 for ; Sat, 18 Nov 2000 14:32:34 -0500 (EST) (envelope-from jhspies@adept.co.za) Received: from spyker (unknown [64.245.8.194]) by ether.adept.co.za (Postfix) with ESMTP for id 05AD2556; Sat, 18 Nov 2000 21:30:43 +0200 (SAST) Received: from js by spyker with local (Exim 3.12 #1 (Debian)) id 13xCFS-0000PC-00 for ; Sat, 18 Nov 2000 19:57:58 +0200 Date: Sat, 18 Nov 2000 19:57:58 +0200 From: Johann Spies To: "pgsql-sql@postgresql.org" Subject: Re: how many rows? [was Re: fetching rows] Message-ID: <20001118195757.B1494@adept.co.za> Mail-Followup-To: "pgsql-sql@postgresql.org" References: <39FDC5BC.43C5AE76@propertykey.com> <00111622091407.30061@comptechnews> <3A14F3E8.1FD2685F@ressource-toi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i In-Reply-To: <3A14F3E8.1FD2685F@ressource-toi.org>; from arnaud@ressource-toi.org on Fri, Nov 17, 2000 at 10:01:28AM +0100 X-Archive-Number: 200011/149 X-Sequence-Number: 180 On Fri, Nov 17, 2000 at 10:01:28AM +0100, Arnaud Vandyck wrote: > "Robert B. Easter" wrote: > > > > > 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; > > I did know it was possible but did not know how to do, thanks (It was > not my question but I'm glad to see the solution:) > > and how can I know how many rows are returned by the query? If you use ruby's interface to postgresql you can use num_tuples to determine how many rows are returned by the query. Ruby is an exiting young language somewhat like python. Johann. -- J.H. Spies - Tel. 082 782 0336 / 023 55 11 568 "A Song for the sabbath day. It is a good thing to give thanks unto the LORD, and to sing praises unto thy name, O most High." Psalms 92:1