Re: Can This be done

From: Steve Lane <slane(at)fmpro(dot)com>
To: Uros Gruber <uros(at)sir-mag(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can This be done
Date: 2002-05-13 17:47:01
Message-ID: B9056645.D24B%slane@fmpro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/12/02 3:22 PM, "Uros Gruber" <uros(at)sir-mag(dot)com> wrote:

> Hi!
>
> Is it possible for example I have one db with 100.000
> entries. I select some data, let say about 1.000. Now i want
> this data show on page by pages.
>
> I use limit and ofset for this. But how can i know how much
> is all the records. Because i want to print also how many
> hits were but i don't want get all the rows at once.
>
> Is there any function for this or i have to make 2 queries.

In most implementations I've seen, which is mostly middleware such as PHP,
if you aren't going to get all the rows at once, you need two queries. The
"function" that you want, that tells you the number of rows matching
criteria X, is, after all, a SELECT statement ... :->

-- sgl

=======================================================
Steve Lane

Vice President
Chris Moyer Consulting, Inc.
833 West Chicago Ave Suite 203

Voice: (312) 433-2421 Email: slane(at)fmpro(dot)com
Fax: (312) 850-3930 Web: http://www.fmpro.com
=======================================================

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2002-05-13 17:47:03 Re: time in 7.2
Previous Message Randall Perry 2002-05-13 17:31:34 Re: Serious environment problem with 7.2 on Solaris