select concat(pt.pname," ",pt.fname," ",pt.lname) as ptname,concat(pt.addrpart," หมูที่ ",pt.moopart," ต.",t3.name," อ.",t2.name," จ.",t1.name) as fulladdressname
from patient pt
left outer join thaiaddress t1 on t1.chwpart=pt.chwpart and
t1.amppart="00" and t1.tmbpart="00" '+
left outer join thaiaddress t2 on t2.chwpart=pt.chwpart and
t2.amppart=pt.amppart and t2.tmbpart="00"
left outer join thaiaddress t3 on t3.chwpart=pt.chwpart and
t3.amppart=pt.amppart and t3.tmbpart=pt.tmbpart
where pt.hn="000000001"
ปรับเอานะครับไม่รู้ว่าตรงตามต้องการไหม