ลองใช้ SQL trace windows ช่วยมันออกมั๊ยครับ
select concat(p.pname,p.fname,' ',p.lname) as ptname, t.name as pttype_name,
r.* ,v.* ,a.age_y as age_ya,a.pcode as pcodea
from rcpt_print r
left outer join vn_stat v on v.vn=r.vn
left outer join an_stat a on a.an = r.vn
left outer join patient p on p.hn=r.hn
left outer join pttype t on t.pttype=r.pttype
where r.hn = '540002768'
order by r.finance_number