เบาหวาน ความดัน เบาหวาน+ความดัน
HT —> i10-i159
DM—> E10-E149
/* select * from ovstdiag
where icd10 between ‘i10’ and ‘i159’ or icd10 between ‘e10’ and ‘e149’
group by hn //ทั้งหมด
/* select ht.* from (select * from ovstdiag where icd10 between’i10’and ‘i159’ group by hn) as ht
left join (select * from ovstdiag where icd10 between ‘e10’ and ‘e149’ group by hn)as dm
on dm.hn=ht.hn
where dm.icd10 is null //เบาหวาน กับ ความดัน
/* select dm.* from (select * from ovstdiag where icd10 between ‘e10’ and ‘e149’ group by hn)as dm
left join (select * from ovstdiag where icd10 between ‘i10’ and ‘i159’ group by hn) as ht
on ht.hn=dm.hn
where ht.icd10 is null //ความดัน
/* select dm.hn,dm.icd10,dm.vstdate,dm.hn,ht.icd10,dm.vstdate from (select * from ovstdiag where icd10 between ‘i10’ and ‘i159’ group by hn) as ht
inner join (select * from ovstdiag where icd10 between ‘e10’ and ‘e149’ group by hn)as dm
on ht.hn=dm.hn //เบาหวาน
ความเห็นล่าสุด