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

how to get the total number of records in report

From: AI Rumman <rummandba(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: how to get the total number of records in report
Date: 2010-10-18 05:16:11
Message-ID: (view raw or whole thread)
Lists: pgsql-performance
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 part of the query.
Is there any other good alternative way to get this similar value?


pgsql-performance by date

Next:From: Samuel GendlerDate: 2010-10-18 06:13:01
Subject: Re: No hash join across partitioned tables?
Previous:From: Merlin MoncureDate: 2010-10-16 19:54:14
Subject: Re: Stored procedure declared as VOLATILE => no good optimization is done

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