select id, count(*) from yourTable having count(*) > 1

解决方案 »

  1.   

    select id, count(*) from yourTable group by ID having count(*) > 1
      

  2.   

    也可以用自连接
    select a.id
    from tablename a,tablename b
    where a.id:=b.id and .....(全部字段)
    看了比较麻烦,呵呵
      

  3.   

    确实需要加group by id。
    select id, count(*) from yourTable group by id having count(*) > 1
      

  4.   

    不知道你找它干什么?
    如果想去掉一个记录  就必须找它的ID,上面的方法都行。如果查询时只出现一个记录,那SQL本身就有这功能。