select a,count(*) zs from tab1 group by a;

解决方案 »

  1.   

    select * 
    from tablea a,(select c1,c2,min(rownum) mynum from tablea
    group by c1,c2) c
    where   a.c1= c.c1
    and     a.c2=c.c2
    and     a.rownum = c.mynumand     exists
    (select c1,c2,count(*)  cnt from tablea
     where a.c1= b.c1
     and   a.c2= b.c2
     
       group by c1,c2
             having count(*) >1) 
      

  2.   

    SELECT COUNT(*) INTO ZS FROM TABLE_A A WHERE A.ROWID <> (SELECT MIN(B.ROWID) FROM TABLE_A B WHERE A.FIELD1=B.FIELD1)
      

  3.   

    to  honghulong(红湖龙) : 能说明语句的意思么?太冲了,很难明白,mynum 是什么?rownum是什么?
      

  4.   

    select count(*),field1 from table where .... group by field1