Solved

Sum sql query

Posted on 2014-10-31
2
120 Views
Last Modified: 2014-10-31
Hi,

I have a table with data looking as below:
Design of tableTable result
I would like to sum the different events so the result will be like this:
Event                Quantity
Processed        4
Delivered         4
Open                6
Click                 3

How should my query look like to make this happen?

Thanks for help!

Peter
0
Comment
Question by:peternordberg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Assisted Solution

by:Haris Djulic
Haris Djulic earned 250 total points
ID: 40415194
use this:

select event, count(*)
from customerGruopmailstatistics
group by event

Open in new window

0
 
LVL 5

Accepted Solution

by:
ReneD100 earned 250 total points
ID: 40415196
SELECT event, Count(event) AS Qty
FROM cgms
GROUP BY event;

Open in new window

0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question