select c1,(select count(*) from a where c1='c') sum1,
(select count(*) from a where c1='c' and n1>2) sum2
 from a where c1='c'

解决方案 »

  1.   

    select tab1.aa,tab1.bb,tab2.dd from 
     (select c1 aa,count(*) bb from your_table group by c1) tab1,
    (select c1 cc,count(*) dd from your_table where nl>2 group by c1) tab2
     where tab1.aa=tab2.cc;
      

  2.   

    select c.c1, max(a.b), max(b.c) from 
    (select c1, count(*) b from table1 group by c1) a,
    (select c1, count(*) c from table1 where nl>2 group by c1) b,
    table1 c
    where a.c1(+)=c.c1 and b.c1(+)=c.c1
      

  3.   

    select c1, count(*) sum1, sum(decode(sign(n1-2),1,1,0)) sum2
    from yourtable
    where c1='c'
    group by c1
      

  4.   

    偶刚学oracle,看起来Lastdrop(空杯)的最好了,其他的偶都看不懂,是不是这样的?
      

  5.   

    是的,Lastdrop(空杯)的方法最容易理解