select oo.icode,concat(d.name," ", d.unit) name
,sum(oo.qty) qty,sum(oo.sum_price) sum_price
from opitemrece oo
join nondrugitems d on oo.icode=d.icode
left join income inc on inc.income=oo.income
where oo.vstdate between '2015-1-1' and '2015-1-31'
and inc.income_group=12
group by d.icode
order by sum_price desc
ตาราง nondrugitems ของผมไม่มีฟิล์ด strength,units