select count(*) and limit - Mailing list pgsql-novice

From Verena Ruff
Subject select count(*) and limit
Date
Msg-id 446C519E.6050507@triosolutions.at
Whole thread Raw
Responses Re: select count(*) and limit
Re: select count(*) and limit
List pgsql-novice
Hi,

sometimes I have queries with a LIMIT statement. Now I'd like to present
the user the returned records and inform him how many records there are
if there was no LIMIT statement. Is it possible to get all neccessary
information with one query?
This works:
SELECT * FROM table LIMIT 20
SELECT count(*) FROM table
But is it possible to have one query returning both, the records and the
count?

regards,
Verena

pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Querying from two tables as if they were appended
Next
From: Sean Davis
Date:
Subject: Re: select count(*) and limit