I have this query that returns me the number of dates equal:
SELECT 'Data', COUNT('Data') AS 'Quantidade' FROM sua_tabela GROUP BY 'Data';
| Data | | 2016-06-09 | | 2016-06-09 | | 2016-06-09 | | 2016-06-08 | | 2016-06-08 | | 2016-06-05 | | 2016-06-01 |
Return like this:
| Data | Quantidade | | 2016-06-09 | 3 | | 2016-06-08 | 2 | | 2016-06-05 | 1 | | 2016-06-01 | 1 |
I would like to add the Quantity returned for this month
I tried this way:
SELECT Data_reg, SUM(COUNT(Data_reg)) AS 'Soma_total'
FROM Monit
WHERE Data_reg like ('2016-06%')
GROUP BY 'Data_reg';
However, you returned the following error:
SQL Error (1111): Invalid use of group function