This question is an exact duplicate:
How to select in the array and publish the data for the month from the database with a breakdown of data for each day? 
This question is an exact duplicate:
How to select in the array and publish the data for the month from the database with a breakdown of data for each day? 
This question has been marked as a duplicate of an existing one.
The following query will aggregate the number of records sought by day.
SELECT DATE(dt), COUNT(i) FROM leads WHERE lead = 'l' GROUP BY DATE(dt) http://sqlfiddle.com/#!9/5617d/2
The query will aggregate over the records that have the value l in the lead field, counting (the COUNT function) the number of such records for each day ( DATE(dt) ). Perhaps there are more optimal solutions, but most likely this request will be fulfilled in less than 100ms.
Additional conditions can be specified using the HAVING operator, which works in a way similar to WHERE , but operates on aggregated data.
Please check out the question next time so that you can understand from it what you want. Now this is not.
Source: https://ru.stackoverflow.com/questions/611497/
All Articles