jeniferfleurant icon

mother code forme mere enfant

jeniferfleurant | PRO | 09/14/18 12:42:15 PM UTC | 0 ⭐ | 282 👁️ | Never ⏰ | []
MySQL |

930 B

|

None

|

0 👍

/

0 👎

select mother.patient_code as mother_code, 
 
child.patient_code as child_code, 
if(testing_mereenfant.id_patient is null, if((select id_patient from testing_mereenfant where id_patient=child_linked.id) is null, 'non','oui')
 
,'oui') as 'forme mereenfant?' 
 
from tracking_motherbasicinfo
left join tracking_children on tracking_children.id_patient_mother=tracking_motherbasicinfo.id_patient
left join testing_mereenfant on tracking_children.id_patient_child = testing_mereenfant.id_patient
left join testing_specimen on testing_specimen.id_patient = tracking_children.id_patient_child
left join patient mother on mother.id = tracking_motherbasicinfo.id_patient
left join patient child on child.id = tracking_children.id_patient_child
left join patient child_linked on child_linked.linked_to_id_patient = tracking_children.id_patient_child
where id_patient_child!=0 and id_patient_child!=id_patient_mother and mother.patient_code is not null

Comments