select *
from  table
where  (a in
        (select a
      from table
      group by a
      having count(*) > 1))
order by  a dese

解决方案 »

  1.   

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

  2.   

    删掉重复的:alter table 表 add  newfield int identity(1,1)delete 表
    where newfield not in(
     select min(newfield) from 表 group by 除newfield外的所有字段
                         )alter table 表 drop column newfield----------------------------------------------------
    select * into #temp from 表 group by 所有列
    truncate table 表
    insert 表 select * from #temp
    drop table #temp
    -----------------------------------------
      

  3.   

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