Friday, March 27, 2020

SQL GROUP BY field and SUM

I have a query that sums categories.  But I would like a sum of all those numbers as the last row.
SELECT sum(dead) AS ['dead'], incidents.category AS ['Category']
FROM incidents
GROUP BY incidents.category
;
There has to be a way to get a total of all those sums that does not require a separate query.

1 comment:

  1. Nope. You could ADD a field that sums each row cumulatively though.

    ReplyDelete