码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2015-07-12 10:53:19      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

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

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

标签:

原文地址:http://www.cnblogs.com/FKdelphi/p/4640587.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!