total row count for selects with a limit

Поиск
Список
Период
Сортировка
От Peter
Тема total row count for selects with a limit
Дата
Msg-id 005001c176c3$ef8d4e00$0300000a@600mlPeterPC1
обсуждение исходный текст
Список pgsql-php
Hi there,
 
what seems to be the best way of getting the total row number on select queries with a limit on them?
 
What I am currently thinking of doing is building select queries dynamically and wrapping all selected fields into the count() function without the limit
 
somthing like:
 
select a,b,c from table limit 10
 
and for total count
 
select count(a,b,c) from table
 
and a function to build the select query with parameters such as
 
function build_select($table, $cols=array(), $limit, $orderby, $where) { ... }
 
I am going in the right direction? Instead of one query I need 2 is there a way of making it just one query?
 
thanks for any help
 
regards, Peter

В списке pgsql-php по дате отправления:

Предыдущее
От: "Millsap, Michael G"
Дата:
Сообщение: PostgreSQL pseudo cluster
Следующее
От: "Dan Wilson"
Дата:
Сообщение: Re: Connection problem