select a.itemcode,b.itemname,b.spec,b.unit,b.rprice,sum(a.rqty) rqtyfrom tm_possale_detail a,sys_iteminfo bwhere a.itemcode=b.itemcode group by a.itemcode,b.itemname,b.spec,b.unit,b.rpriceorder by 6 desc select a.itemcode,b.itemname,b.spec,b.unit,b.r…