写个土方法
with tt as(
select 1 id,'c1' nn from dual
union
select 2,'c2' from dual
union
select 3,'c3' from dual
)
select sum(c1) c1,sum(c2) c2,sum(c3) c3
from
(select case nn when 'c1' then id else 0 end c1,
case nn when 'c2' then id else 0 end c2,
case nn when 'c3' then id else 0 end c3
from tt)