这个思路试试:按Date分组后取Min(ID)

解决方案 »

  1.   

    数据是刚好重复一次的用MIN是可以,但是像2015-02-05有三条的就搞不了了
      

  2.   

    if object_id('a') is not null  drop table a
    go
    create table a(id int identity(1,1),
                   date datetime)
    go
    insert into a values('2015-02-04')
    insert into a values('2015-02-05') 
    insert into a values('2015-02-05')
    insert into a values('2015-02-05')
    insert into a values('2015-02-06')
    insert into a values('2015-02-06')go
    delete from a where id not in (select MIN(id) as id from a group by date)
    go
    select * from a
      

  3.   

    谢谢!折腾了半天 ,多加了having count(date)>1
      

  4.   


    select * from a
    select * from b