select sum(a)+sum(b) 
  from table a
 where c=0
union
select sum(a)+sum(b)
 from table a
where c=1

解决方案 »

  1.   

    select c,sum(a)+sum(b)
      from table
     group by c
      

  2.   

    select pp.c1,mm.c0 from (select sum(a)+sum(b) as c1
                      from tt
                     where c=1) pp,(select sum(a)+sum(b) as c0
                      from tt
                     where c=0) mm
      

  3.   

    select SUM(DECODE(c,0,a+b)),
           SUM(DECODE(c,1,a+b))
      from 表 是這樣的意思嗎
      

  4.   

    liuyi8903(西西) 支的招应该可行?楼主所说的列集是指什么?
      

  5.   

    liuyi8903(西西)的
    select c,sum(a)+sum(b)
      from table
     group by c这个最好