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

解决方案 »

  1.   


    语法上没错。逻辑上错了。你现在此字段不是自增的,准备删除之后改成自增的,对吗?select nid=identity(int,1,1),* into #t from contenttruncate table content  --运行前最好备份一次。insert content 
    select 除nid字段外的全部字段
    from #t a 
    where nid in (select max(nid) from #t group by id)drop table #t