I have a query in MS Access that display's the following information:
ID | Count | Complete_Type |
---|---|---|
UserA | 10 | Replied |
UserA | 20 | Sent |
UserA | 30 | Closed without Response |
I want to create a new SQL query that uses the query above but sum's the count's for each unique user only with Completed Type's "Replied" and "Closed without Response". So example, the new query would display this:
ID | Count |
---|---|
UserA | 40 |
Is anyone able to help me write this query?
You can use a where
clause:
select id, sum(count)
from t
where Complete_Type in ('Replied', 'Closed without Response')
group by id;