SQL2008-删除时间字段重复的方法
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
欢迎关注我,一起进步!扫描下方二维码即可加我