Guest User

Untitled

a guest
Oct 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. SELECT risk.user_id, (case when bp.user_id is null then 'n' else 'y' end) as bp_test,
  2. (case when risk.user_id is null then 'n' else 'y' end) as hiv_test
  3. FROM `risk_Assessment_questions_2016` as risk
  4. left join `bp_a1c_risk_ques_2016` as bp on bp.user_id = risk.user_id
  5. left join test_type_verification as test on risk.user_id = test.user_id
  6. where (risk.__posted__ like '%2017-08%' or bp.__posted__ like '%2017-08%')
  7. and test.user_id is null
  8. GROUP by risk.user_id
Add Comment
Please, Sign In to add comment