Skip to content
Advertisement

right way to get sum of all the counts done in sql

This is my query, I want to get how many numbers of phones call received today as one column, so how do I do a sum using count function?

If I do a sum, that would just return the total sum? how do I return the total numbers of all calls received today, I would do count uniquecallerID and then put them into sum. How do I do that?

Sample data:

Advertisement

Answer

Are you looking for count(distinct)? Assuming that uniqueCallerID identifies what you want to count:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement