i wanna Count insertions which have the type = "non_repondu" and group the results by 3 criteria.
1-client_id
2-queue_id
and
3- datetime : by hour , day , by month and by year
So far i have done this:
SELECT `client_id`,`queue_id`,`datetime`,COUNT(`type`)
AS nombre_appels_repondus
FROM `appels`
where `type`= "non_repondu"
group by `appels`.`client_id`,`appels`.`queue_id`,`appels`.`datetime
but like that i have just filtered by the full datetime column which results me a table of every unique datetime line separately , how can i get result by hour , day , month and year ???