Re: [PERFORM] how to get the total number of records in report

2010-10-28 Thread Merlin Moncure
On Thu, Oct 28, 2010 at 1:49 PM, AI Rumman wrote: > But I am using Postgresql 8.1 and it is not possible to write query as your > one here. with 8.1, you are limited to subquery approach, application derived count, plpgsql hacks, etc. merlin -- Sent via pgsql-performance mailing list (pgsql-pe

Re: [PERFORM] how to get the total number of records in report

2010-10-28 Thread AI Rumman
But I am using Postgresql 8.1 and it is not possible to write query as your one here. On Thu, Oct 28, 2010 at 11:05 PM, Robert Haas wrote: > On Tue, Oct 19, 2010 at 7:56 PM, Merlin Moncure > wrote: > > On Mon, Oct 18, 2010 at 1:16 AM, AI Rumman wrote: > >> At present for reporting I use follow

Re: [PERFORM] how to get the total number of records in report

2010-10-28 Thread Merlin Moncure
On Thu, Oct 28, 2010 at 1:05 PM, Robert Haas wrote: > On Tue, Oct 19, 2010 at 7:56 PM, Merlin Moncure wrote: >> On Mon, Oct 18, 2010 at 1:16 AM, AI Rumman wrote: >>> At present for reporting I use following types of query: >>> select crm.*, crm_cnt.cnt >>> from crm, >>> (select count(*) as cnt f

Re: [PERFORM] how to get the total number of records in report

2010-10-28 Thread Robert Haas
On Tue, Oct 19, 2010 at 7:56 PM, Merlin Moncure wrote: > On Mon, Oct 18, 2010 at 1:16 AM, AI Rumman wrote: >> At present for reporting I use following types of query: >> select crm.*, crm_cnt.cnt >> from crm, >> (select count(*) as cnt from crm) crm_cnt; >> Here count query is used to find the to

Re: [PERFORM] how to get the total number of records in report

2010-10-19 Thread Merlin Moncure
On Mon, Oct 18, 2010 at 1:16 AM, AI Rumman wrote: > At present for reporting I use following types of query: > select crm.*, crm_cnt.cnt > from crm, > (select count(*) as cnt from crm) crm_cnt; > Here count query is used to find the total number of records. > Same FROM clause is copied in both the

Re: [PERFORM] how to get the total number of records in report

2010-10-19 Thread Greg Spiegelberg
On Tue, Oct 19, 2010 at 1:18 AM, AI Rumman wrote: > Not actualy. I used pagination with limit clause in details query and I > need the total number of records in the detail query. > > Can you use a cursor? Roughly... BEGIN; DECLARE x CURSOR FOR SELECT * FROM crm; MOVE FORWARD ALL IN x; MOVE BAC

Re: [PERFORM] how to get the total number of records in report

2010-10-19 Thread AI Rumman
Not actualy. I used pagination with limit clause in details query and I need the total number of records in the detail query. On Mon, Oct 18, 2010 at 9:52 PM, Josh Kupershmidt wrote: > On Mon, Oct 18, 2010 at 1:16 AM, AI Rumman wrote: > > At present for reporting I use following types of query:

Re: [PERFORM] how to get the total number of records in report

2010-10-18 Thread Josh Kupershmidt
On Mon, Oct 18, 2010 at 1:16 AM, AI Rumman wrote: > At present for reporting I use following types of query: > select crm.*, crm_cnt.cnt > from crm, > (select count(*) as cnt from crm) crm_cnt; > Here count query is used to find the total number of records. > Same FROM clause is copied in both the