RCPT-FORM ของคุณ youdngean มีปัญหา
select t.*,o.*,d.name as tdrug,n.name as tndrug,n.billcode,n.billnumber,
concat(n.name,'(',n.billcode,')',' Unitprice') as tbillcode,
concat(n.name,'(',n.billnumber,')',' Unitprice') as tbillnumber,n.price
from tempreport t
left outer join opitemrece o on o.finance_number = t.name9 and o.income = t.num1 and o.income not in ('03','54')
left outer join drugitems d on d.icode = o.icode
left outer join nondrugitems n on n.icode = o.icode
where t.reportname="RCPT-116-0698"
order by t.num2
สี่แดง มีปัญหากับ o.income เป็น string แต่ t.num1 เป็น ตัวเลขครับ