解决方案 »

  1.   

    写个土方法
    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) 
      

  2.   

    若是11G后的版本,可以用PIVOT/UNPIVOT来处理
      

  3.   

    select pfkid,max(decode(wrlx,'烟尘',wrvalue)) '烟尘',max(decode(wrlx,'氮氧化物,wrvalue)) 氮氧化物,max(decode(wrlx,'烟气湿度',wrvalue))  烟气湿度 from 表 group by pfkid