BMS-HOSxP Community
HOSxP => Report Exchange => ข้อความที่เริ่มโดย: bannok ที่ กุมภาพันธ์ 07, 2008, 15:52:20 PM
-
ดูคำสั่งนี้ให้หน่อยนะครับว่าถูกต้องไหมเพราะว่าไม่มีข้อมูลรัยเลย
select c.* ,p.*
from clinicmember c
left outer join patient p on p.hn=c.hn
where c.clinic = (select sys_value from sys_var where sys_name="dm_clinic_code")
and c.hn in (select hn from fbshistory where ((fbs1mo+fbs2mo+fbs3mo)/3 > 126) or ((fbs1mo+fbs2mo)/2 > 126) )
and c.hn in (select hn from patient where chwpart="40" and amppart="05" and tmbpart="01" and moopart in ("1","2","3","4")
and birthday < "1946-08-01"
)
-
ผมลองทดสอบโดยการเปลี่ยนเป็นรหัสจังหวัด อำเภอ ตำบลที่ผมมีก็มีข้อมูลนี่ครับ
ลองตรวจสอบข้อมูลแต่ละตารางที่เกี่ยวข้องดูอีกทีครับ
:-\ :-\ :-\