อยากได้ผู้ป่วย DM,HT ที่ death ขอบคุณค่ะ
select p.cid,concat(p.pname,p.fname,' ',p.lname) as name,p.birthdate,p.age_y,pd.death_date,pt.addrpart,pt.moopart,t.full_name ,cn.person_id
from person_death pd,person p,thaiaddress t,patient pt ,
person_chronic cnwhere cn.person_id=pd.person_id and pd.person_id=p.person_id and pt.cid=p.cid and t.addressid= concat(pt.chwpart,pt.amppart,pt.tmbpart)
order by t.full_name