คือจะดึงคนไข้ที่เป็นเบาหวานตรวจ HbA1c ที่มีผลน้อยกว่า 7
แต่เขียนโค๊ดแบบนี้ไป ทำไมผลที่มีค่า มากกว่า 7 ถึงออกมาด้วยคะ
select pt.hn,ov.pdx , lo.lab_order_result
from vn_stat ov, ovst ovst, patient pt ,lab_head lh , lab_order lo
where ov.vn=ovst.vn and pt.hn=ov.hn
and ov.vn= lh.vn and lh.lab_order_number = lo.lab_order_number
and ov.vstdate between "2011-10-01" and "2012-06-30"
and lo.lab_items_code = '48'
and lo.lab_order_result < '7'
and ( (ov.pdx >= "e100" and ov.pdx <= "e149")
or (ov.dx0 >= "e100" and ov.dx0 <= "e149")
or (ov.dx1 >= "e100" and ov.dx1 <= "e149")
or (ov.dx2 >= "e100" and ov.dx2 <= "e149")
or (ov.dx3 >= "e100" and ov.dx3 <= "e149")
or (ov.dx4 >= "e100" and ov.dx4 <= "e149")
or (ov.dx5 >= "e100" and ov.dx5 <= "e149") )
group by pt.hn