jeniferfleurant icon

familymember_by_hospital

jeniferfleurant | PRO | 10/14/15 02:18:28 PM UTC | 0 ⭐ | 277 👁️ | Never ⏰ | []
MySQL |

670 B

|

None

|

0 👍

/

0 👎

select concat(lookup_hospital.city_code,'/',lookup_hospital.hospital_code) as hospital_code,  sum(f_under_1) as f_under_1, sum(f_1_4) as f_1_4, sum(f_5_9) as f_5_9, sum(f_10_14) as f_10_14, sum(f_15_17) as f_15_17, sum(f_18_25) as f_18_25, sum(f_25) as f_25, 
sum(m_under_1) as m_under_1, sum(m_1_4) as m_1_4, sum(m_5_9) as m_5_9, sum(m_10_14) as m_10_14, sum(m_15_17) as m_15_17, sum(m_18_25) as m_18_25, sum(m_25) as m_25
from tracking_familymember 
left join club_patient on club_patient.id_patient = tracking_familymember.id_patient
left join club on club_patient.id_club = club.id
left join lookup_hospital on lookup_hospital.id = club.id_hospital
group by club.id_hospital

Comments