Colin
Colin

Reputation: 735

SQL - Count Distinct Occurrences?

I have a database like this:

Name, Day, Calls

The day represents the date, the calls the number of phone calls they made. Is there an SQL syntax to return the total calls made on that day? I'm presuming its COUNT DISTINCT but I cannot make it return the instance of e.g. two people, same day and the return should be the total for both.

Upvotes: 0

Views: 535

Answers (1)

Diomidis Spinellis
Diomidis Spinellis

Reputation: 19385

SELECT Day, SUM(Calls) FROM table GROUP BY Day;

Upvotes: 1

Related Questions