以时间字段为条件,如何删除一段时间内的记录
db2吧
全部回复
仅看楼主
level 1
函盈 楼主
delete from smsinfo where BETWEEN smsdate like '%2013-05-18%' and smsdate like '%2013-05-28%'
要删除这段时间的记录,哪位大神帮忙看看哪里错了
2013年10月16日 03点10分 1
level 11
delete from smsinfo where smsdate between '2013-05-18' and '2013-05-28'
2013年10月20日 10点10分 2
level 1
最好先执行
select * from smsinfo where BETWEEN '2013-05-18' and '2013-05-28'
在执行
delete from(select * from smsinfo where BETWEEN '2013-05-18' and '2013-05-28'
2013年10月24日 02点10分 3
1