Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE caris_db;
- SET @start_date= "2017-01-01";
- select count(*) from tracking_infant where
- timestampdiff(year,dob,@start_date)<=18 and
- (is_dead=0 or year(death_date)>=2017)
- and
- (is_abandoned=0 or year(abandoned_date)>=2017)
- and
- tracking_infant.id_patient in (
- select * from(
- select id_patient from tracking_followup where on_arv=1
- union
- select id_patient from tracking_regime
- )j
- )
- and id_patient in (select id from patient where linked_to_id_patient=0)
Advertisement
Add Comment
Please, Sign In to add comment