jeniferfleurant

Enfant positive actif pendant un intervalle

Dec 13th, 2016
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.52 KB | None | 0 0
  1. set @start_date = '2016-07-01';
  2. set @end_date = now();
  3. select * from view_patient_positive where
  4. id in (select id_patient from tracking_infant where timestampdiff(month,dob,@start_date)<=59 and timestampdiff(month,dob,@end_date)>=6)
  5. and
  6. linked_to_id_patient = 0 and
  7. (id in (select id_patient from tracking_followup where date between @start_date and @end_date)
  8. or
  9. id in (select id_patient from testing_specimen where date_blood_taken between @start_date and @end_date
  10. or pcr_result_date  between @start_date and @end_date
  11. ))
Add Comment
Please, Sign In to add comment