รบกวนหน่อยค่ะ IPD ทวงมาหลายครั้งแล้วค่ะ
select lh.*,concat(pt.pname,pt.fname,' ',pt.lname) as full_name,
sx.name as sex_name,lh.hn,lo.lab_items_sub_group_code,
lisg.lab_items_sub_group_name,lo.lab_order_result,
lo.lab_items_name_ref,li.lab_items_unit,lh.reporter_name as code_reporter ,
ou.name as reporter,d.name as doctor ,li.lab_items_normal_value,
concat(vs.age_y,vs.age_m,vs.age_d) as age ,lo.lab_items_code
from lab_head lh
left outer join lab_order lo on lo.lab_order_number = lh.lab_order_number and (lo.lab_order_result is not null and lo.lab_order_result <>'')
left outer join vn_stat vs on vs.vn = lh.vn
left outer join patient pt on pt.hn=lh.hn
left outer join opduser ou on ou.loginname=lh.reporter_name
left outer join doctor d on d.code=ou.doctorcode
left outer join sex sx on sx.code=pt.sex
left outer join lab_items_sub_group lisg on lisg.lab_items_sub_group_code=lo.lab_items_sub_group_code
left outer join lab_items li on li.lab_items_code=lo.lab_items_code
where lo.confirm='Y' and
lh.lab_order_number = 396144order by lo.lab_items_sub_group_code ,li.display_order,li.lab_items_name
มันไม่ถูกครับ มันรันข้อมูลไม่ได้
ต้องเขียน sql ใหม่