日期:2014-05-17 浏览次数:20937 次
--上面有误,这个 with TB_ITEM_INFO as( select 'value1' item_name, 1.0 item_data from dual union all select 'value2' item_name, 2.0 item_data from dual union all select 'value3' item_name, 3.0 item_data from dual) SELECT SUM(decode(item_name, 'value1', item_data, 0)) value1, SUM(decode(item_name, 'value2', item_data, 0)) value2, SUM(decode(item_name, 'value3', item_data, 0)) value3 FROM TB_ITEM_INFO;