Re: how many rows? [was Re: fetching rows]

From: Johann Spies <jhspies(at)adept(dot)co(dot)za>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how many rows? [was Re: fetching rows]
Date: 2000-11-18 17:57:58
Message-ID: 20001118195757.B1494@adept.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message j.uy 2000-11-18 20:51:56 newbie: execute an sql script
Previous Message Max Fonin 2000-11-18 12:08:47 Re: is there a mysql to postgresql sql converter?