อาจารย์ครับอันนี้เป็นคำสั่งในรายงานครับ
select concat(p.pname,p.fname," ",p.lname) as ptname, p.hn, o.rxdate, v.age_y, concat(d.name,d.strength,d.units) as drugname,
opn.presc_reason, concat(i.code,i.name,"(",i.tname,")") as diag, o.qty, o.sum_price,z.name
from ovst_presc_ned opn
join drugitems d on d.icode = opn.icode
join opitemrece o on o.vn = opn.vn and o.icode = opn.icode
join patient p on p.hn = o.hn
join vn_stat v on v.vn = o.vn
left outer join icd101 i on i.code = v.pdx
left outer join doctor z on z.code=opn.doctor
where opn.vn = "530803071752" and opn.doctor = "109" and opn.icode not like "1000313" and o.qty>0