ลองอันนี้
select i1.*,i2.*,p.*,id.*,concat(i2.age_y,"ปี"," ",i2.age_m,"เดือน"," ",i2.age_d,"วัน") as Full_age,pty.name as pttype_name,w.name as ward_name,
do.name as doctor_name
from ipt i1,iptadm id,an_stat i2,patient p,pttype pty,ward w,doctor do
where i1.an=i2.an and i1.hn=p.hn and id.an=i1.an and do.code=i2.dx_doctor and pty.pttype=i2.pttype and w.ward=i1.ward and i1.an="510001234"