jeniferfleurant

pregnancy by month

Sep 7th, 2018
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.34 KB | None | 0 0
  1. select left(patient_code,8) as hospital, count(id_patient_mother) as nbr, concat(month(dpa),'-',year(dpa)) as month_year_dpa
  2. from tracking_pregnancy
  3. left join patient on patient.id=id_patient_mother
  4. where dpa between '2017-08-01' and '2018-08-31'
  5. GROUP BY concat(month(dpa),'-',year(dpa)), left(patient_code,8)
  6. order by year(dpa),month(dpa)
Advertisement
Add Comment
Please, Sign In to add comment