select left(patient_code,8) as hospital, count(id_patient_mother) as nbr, concat(month(dpa),'-',year(dpa)) as month_year_dpa from tracking_pregnancy left join patient on patient.id=id_patient_mother where dpa between '2017-08-01' and '2018-08-31' GROUP BY concat(month(dpa),'-',year(dpa)), left(patient_code,8) order by year(dpa),month(dpa)
Comments