I have a table with the following fields:
I need a query that will get a count for each Name for a particular date. I also need a total count for all the names on a particular date.
I want to display it in one query so I have something like that:
SELECT t1.Data, t1.Name, t1.Count, t2.Total FROM Table1 as t1,
(SELECT Date, SUM(Count) AS Total FROM Table1 WHERE Date='03/06/2017' GROUP BY Date) as t2
WHERE t1.Date=t2.Date AND t1.Date = '04/09/2012'
SELECT * FROM Table1 WHERE Date = '03/06/2017'
SELECT '03/06/2017', 'Total', '', SUM(Count) AS Total FROM Table1 WHERE Date = '03/06/2017'
I do not really like either of these solutions and wondering if there is a better alternative I have not thought of