select 代号,sum(decode(商品,'商品1',金额)),
            sum(decode(商品,'商品2',金额)),
            sum(件数),
            sum(金额)
from tab1
group by 代号