select * from table
where exists(selet * from table t 
         where t.pk1 = table.pk1
           and t.pk2 = table.pk2
            ...
           and t.pkn = table.pkn)
--pk-->primary key

解决方案 »

  1.   

    select a from table group by a having count(1)=1;
      

  2.   

    select * from(select count(1)  cc ,a.a from a group by a) b where b.cc>1;
      

  3.   

    sorry,
    select a from table group by a having count(1)>1;
      

  4.   

    select * from table group by a having count(a)>1
      

  5.   

    select a from table group by a having count(1)>1;
      

  6.   

    感谢大家.
    beckhambobo(beckham)的方法最好,一步就求出来了,简单明了.
    bzszp(SongZip)的sql应该改为
    select * from(select count(1)  cc ,a.a from a group by a.a) b where b.cc>1;
    似乎不太简洁.
    supershb(phenix) 的sql我不太理解.