ประมาณนี้เปล่าครับ
SELECT lh.hn,i.an,concat(lh.order_date,' ',lh.order_time) as order_datetime,
concat(pt.pname,pt.fname,' ',pt.lname) as pt_name,lh.department,
lh.order_department,lh.reporter_name,lh.confirm_report,lh.vn,ia.bedno
FROM lab_head lh
LEFT OUTER JOIN ipt i ON i.hn = lh.hn
LEFT OUTER JOIN patient pt ON pt.hn = lh.hn
LEFT OUTER JOIN iptadm ia ON ia.an = i.an
WHERE lh.department="IPD" AND lh.order_date="2013-07-31" AND lh.confirm_report="Y"
AND i.dchdate is NULL
ORDER BY lh.hn