ดูคำสั่งนี้ให้หน่อยนะครับว่าถูกต้องไหมเพราะว่าไม่มีข้อมูลรัยเลย
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"
)