select SUM(DECODE(TWMS_INVTRANSLINE.itemtype,
'Material ',
TWMS_INVTRANSLINE.statactitemqty )) Price
from TWMS_INVTRANSLINE
GROUP BY TWMS_INVTRANSLINE.ITEMDESC
这句SQL用DB2的语法要怎么写
------解决方案--------------------------------------------------------
select ITEM,
sum(case itemtype when 'Material ' then statactitemqty else 0 end) Price
from TWMS_INVTRANSLINE
GROUP BY TWMS_INVTRANSLINE.ITEM