так пойдёт SELECT concat(EXTRACT(YEAR FROM ps_datetime ), '.' , EXTRACT(MONTH FROM ps_datetime)) AS SortDate, concat(EXTRACT(YEAR FROM ps_datetime ), ' ' , EXTRACT(MONTH FROM ps_datetime)) AS MyDate, COUNT(ps_id)
FROM `patient_services`
GROUP BY SortDate
тогда так SELECT concat(EXTRACT(YEAR FROM ps_datetime ), '.' , EXTRACT(MONTH FROM ps_datetime)) AS MyDate, COUNT(ps_id)
FROM `patient_services`
GROUP BY MyDate