select cast(h.address as integer) as address_int,h.village_id,concat(hc.hosptype," ",hc.name) as hospital_name,h.address,p.* ,pc.name as pttype_name,x.name as sex_name from person p left outer join house h on h.hos_guid = p.house_guid left outer join pttype pc on pc.pttype_guid = p.pttype_guid left outer join sex x on x.hos_guid = p.sex_guid left outer join hospcode hc on hc.hospcode = p.hospcode where p.cid = "xxxxxxxxxxxxx" and p.hospcode<>"11208" order by address_int,p.person_id
คำสั่งนี้ ผม เอา ออกมา Run ที่ SQL ก็ แฮ้ง ครับ