Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.43 KB | None | 0 0
  1. select v.vn,v.hn,er.vn as er ,v.pdx,d.death_diag_1,v.vstdate
  2. from vn_stat v
  3. inner join ovst ov on ov.vn = v.vn
  4. inner join icd101 i on i.code = v.pdx
  5. left join death d on d.hn = v.hn and d.death_date = v.vstdate
  6. left join er_regist er on er.vn = v.vn and er.er_dch_type = '4'
  7.  
  8. where v.vstdate between '2016-10-01' and '2017-09-30'
  9. and (ov.an = "" or ov.an is null)
  10. and (er.vn is not null or d.hn is not null)
  11.  
  12. order by v.vn asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement