select patient_code, id_patient from club_patient left join club on club_patient.id_club=club.id left join club_session on club_session.id_club=club.id left join patient on patient.id=id_patient where year(date)=2016 and patient_code IS NOT null and club_type=1 group by id_patient
Comments