Re: count and limit

From: Chris <dmagick(at)gmail(dot)com>
To: Fabio Victora Hecht <fabiovh(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: count and limit
Date: 2006-08-18 00:34:44
Message-ID: 44E50B24.5090208@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Fabio Victora Hecht wrote:
> Hi!
>
> I've been using Postgresql for a while now and I'm very satisfied.
>
> I was wondering if there's a way to count the results of a query and
> return part of the result set it in one query (LIMIT). Because I usually
> have to count the results using one query (to tell the user how many
> records match the criteria) and show the first 20 records.

I was going to suggest a cursor but I don't think you can get the number
of results a cursor has :(

--
Postgresql & php tutorials
http://www.designmagick.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2006-08-18 00:35:11 Re: Dynamic Partial Index
Previous Message Stephan Szabo 2006-08-17 22:36:33 Re: select * from users where user_id NOT in (select