Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SUM a COUNT function

595446Oct 22 2007 — edited Oct 26 2007
I need to perform a summation on the results of a COUNT but I'm not sure what's the best way to do it.

Example:
TableA
---------------
CaseID (int)
FollowupCorrespondence (int) incremented
CustomerName (varchar)

/**Get the total number of followups for each customer case, and display the customer's name.*/
select sum(count(FollowupCorrespondence)), CustomerName from
tableA
group by caseID, CustomerName;

This produces an error that the functions cannot be nested. How can I get the result that I'm looking for?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2007
Added on Oct 22 2007
17 comments
6,988 views