Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT(o1.person_id)
- FROM obs o1
- WHERE concept_id = 134 #birthday CALL IS effective
- AND value_coded = 144
- AND voided = 0
- AND o1.obs_datetime > (
- SELECT MAX(obs_datetime)
- FROM obs o2
- WHERE concept_id = 107 #person entered birthday wrong 3 times
- AND value_coded = 1
- AND voided = 0
- AND o2.person_id = o1.person_id
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement