279
« เมื่อ: สิงหาคม 01, 2010, 12:15:11 PM »
รบกวนด้วยครับแก้ไขอย่างไรครับ
จะแทรก ขนาดฟิล์มที่ใช้กับคนไข้นะครับ
select staff,x.xn,x.hn,x.request_date,x.request_time,x.report_date,x.report_time,x.doctor,x.xray_type,
concat(p.pname," ",p.fname," ",p.lname) as ptname , d.name as doctor_name ,
d2.name as request_doctor_name , t.name as xray_type_name ,x.vn,x.an ,v.age_y,
xi.* , rx.xn as real_xn
from xray_report x
left outer join patient p on p.hn=x.hn
left outer join doctor d on d.code=x.doctor
left outer join doctor d2 on d2.code=x.request_doctor
left outer join xray_type t on t.xray_type = x.xray_type
left outer join xray_items xi on xi.xray_items_code=x.xray_items_code
left outer join vn_stat v on v.vn=x.vn
left outer join xrayxn rx on rx.hn=x.hn
and rx.regdate between "2010-07-31" and "2010-07-31"
where ( x.request_date between "2010-07-31" and "2010-07-31")
and x.xray_items_code not in (0)
and (x.confirm="Y")