มกราคม 2015
จ. อ. พ. พฤ. ศ. ส. อา.
« ธ.ค.   ก.พ. »
 1234
567891011
12131415161718
19202122232425
262728293031  
มกราคม 2015
จ. อ. พ. พฤ. ศ. ส. อา.
« ธ.ค.   ก.พ. »
 1234
567891011
12131415161718
19202122232425
262728293031  

คลังเก็บรายวัน: มกราคม 9, 2015

เบาหวาน ความดัน เบาหวาน+ความดัน

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  //เบาหวาน

1UKp7