不太清楚你的意思,是不是只查出有ID重复的资料?
Select * from yourTable where ID in (select ID from yourTable group by ID having count(*) > 1)

解决方案 »

  1.   

    不太清楚你的意思。我想可能是这样吧?
    Select [ID],[Data] from tablename where [ID] in (select [ID] from tablename group by [ID] having count(*) > 1)
      

  2.   

    select * from tableName where id in (select id from tableName where count(1)>1)
      

  3.   

    select * from 表 where id in (select id from 表 group by id having count(*)>1)
      

  4.   

    or 
    select * from tableName where id in (select id from tableName where sum(1)>1)
      

  5.   

    不太清楚你的意思。我想可能是这样吧?
    Select [ID],[Data] from tablename where [ID] in (select [ID] from tablename group by [ID] having count(*) > 1)
      

  6.   

    select * from tableName where id in (select id from tableName group by id having count(1)>1)select * from tableName where id in (select id from tableName group by id having sum(1)>1)
      

  7.   

    不太清楚你的意思。我想可能是这样吧?
    Select [ID],[Data] from tablename where [ID] in (select [ID] from tablename group by [ID] having count(*) > 1)
      

  8.   

    select ID, Data from yourtable A
    where (select count(*) from yourtable where id = A.id) = 2
      

  9.   

    看你给出的结果,是查询ID有重复的数据select * from 你的表 where (select id from 你的表 group by id having count(*)>1)
      

  10.   


    select * from 你的表 where (select id from 你的表 group by id having sum(1)>1)
      

  11.   


    select * from 你的表 where (select id from 你的表 group by id having sum(1)>1)