select count(field1) from tablename group by field1 having count>1

解决方案 »

  1.   

    一种笨的办法:
    select * from tablename,
    (select col,count(*) from tablename group by col having(count(*))>1) aa
    where tablename.col=aa.col
      

  2.   

    这个题目已问过n次。这只是其中一种写法:select * from tablename where field1 in (select field1 from tablename group by id having count(*)>1)
      

  3.   

    select count(field1) from tablename group by field1 having count(field1)>1
    对不起,刚才写错了! 
      

  4.   

    我也写错了,呵呵!正确的应该是:
    select * from tablename where field1 in (select field1 from tablename group by field1 having count(*)>1)
      

  5.   

    select a from q_a group by a having (count(a)) > 1