Avatar of batman_k
batman_k
 asked on

Calculation of totals in SQL Query

Greetings All,
Please help me on construction of query where I need to group

Column called ‘CALLDROP’ and total occurrences based on values within a column.
My expectations are like following:

CALLDROP, OCCURRENCES
17, 100
16, 200
18, 300

17,16 and 18 are the real values and 100,200 and 300 are the number of occurrences.

So far my uncompleted code :) :

SELECT *
  FROM [CDRFull].[dbo].[CDRFull]
  WHERE
  CREATION BETWEEN '2011-08-04 00:00:00' AND '2011-08-05 23:59:00'
AND……

Thanks in advance !
Microsoft SQL Server 2005Microsoft SQL Server 2008

Avatar of undefined
Last Comment
batman_k

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
jorgedeoliveiraborges

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Ephraim Wangoya


select CALLDROP, count(*) OCCURRENCES
FROM [CDRFull].[dbo].[CDRFull]
  WHERE
  CREATION BETWEEN '2011-08-04 00:00:00' AND '2011-08-05 23:59:00'
group by CALLDROP
batman_k

ASKER
Thanks a lot !!!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23