Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select v.vn,v.hn,er.vn as er ,v.pdx,d.death_diag_1,v.vstdate
- from vn_stat v
- inner join ovst ov on ov.vn = v.vn
- inner join icd101 i on i.code = v.pdx
- left join death d on d.hn = v.hn and d.death_date = v.vstdate
- left join er_regist er on er.vn = v.vn and er.er_dch_type = '4'
- where v.vstdate between '2016-10-01' and '2017-09-30'
- and (ov.an = "" or ov.an is null)
- and (er.vn is not null or d.hn is not null)
- order by v.vn asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement