Skip site navigation (1) Skip section navigation (2)

number of rows returned from SELECT

From: "Corey" <corey(at)bitworthy(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: number of rows returned from SELECT
Date: 2006-07-28 23:26:24
Message-ID: 200607281626.24562.corey@bitworthy.net (view raw or flat)
Thread:
Lists: pgsql-novice
Hello!

Subject says it all I guess: 

What's the most efficient way of determining the number of rows that 
_would_ be returned after/for a SELECT? Or is this impossible without...
actually... _doing_ a SELECT?

Basically this is for pagination purposes; given a SELECT statement, say,
'SELECT * from table LIMIT 10 OFFSET 10', I'd like to know how many total 
rows would be returned if LIMIT and OFFSET weren't used in the statement.

Basically, same thing this guy was asking for a while ago:
http://www.thescripts.com/forum/thread174930.html


Thanks for the assistance!




Responses

pgsql-novice by date

Next:From: Andrew HammondDate: 2006-07-29 00:16:14
Subject: Re: number of rows returned from SELECT
Previous:From: James G WilkinsonDate: 2006-07-28 22:36:05
Subject: Re: Time Zone Setting

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group