LIMIT, OFFSET and row count 
Author Message
 LIMIT, OFFSET and row count

OK, I have a complicated query in a Web frontend, and I am using LIMIT
and OFFSET.  I want back and next buttons to scroll through results.
In order to determine whether to display the next button, I have to
know whether I have received all the results. yet or not.

SELECT ... FROM ... WHERE ... ORDER BY ... LIMIT 10 OFFSET 12

All I need is a total number of rows in the query, either in the query
or from a Perl function.  (Hell, I'll deal with C about now and modify
the interface if I have to.)  I have tried to change it to:

SELECT ..., COUNT(*) FROM ... WHERE ... ORDER BY ... LIMIT 10 OFFSET
12

I get an error--it needs some stuff in GROUP BY, understandably.

I am using PostgreSQL v7.1.2.

Thanks!

--John Keiser



Sat, 10 Jan 2004 14:44:10 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. Help limiting rows with an offset

2. 2Gig limit on Chunk Plus Offset

3. count of rows without select count(*) command...

4. Row Devices and Chunk offset

5. Row Devices and Chunk offset

6. SQL select that counts the # of parent rows w/o any child rows

7. row numbers, limiting row# for web usage

8. Access 2.0 user count limit, is there one?

9. looping counting limiting script calculation

10. Group by, count, order by and limit

11. DTC Transaction count limit


 
Powered by phpBB® Forum Software