zl程序教程

您现在的位置是:首页 >  后端

当前栏目

SQL2008-删除时间字段重复的方法

方法 时间 删除 重复 sql2008
2023-09-14 08:57:13 时间

ID  EMAgitation_ID    YieldDateTime

1   2                              2012-02-11 10:18:54.000
2   2                              2012-02-11 10:18:54.000
3   2                              2012-02-11 11:28:12.000
4   2                              2012-02-11 11:28:12.000

 

Delete From StuffAgitationYield Where ID in (select MIN(ID) From StuffAgitationYield Group By YieldDateTime,EMAgitation_ID  Having Count(YieldDateTime)>1 and YieldDateTime>='2012-02-01 00:00:00.000' and YieldDateTime<='2012-02-29 00:00:00.000')

 

ID  EMAgitation_ID    YieldDateTime

2   2                              2012-02-11 10:18:54.000
4   2                              2012-02-11 11:28:12.000