我的数据表为
create table test(id int identity primary key,
logTime nvarchar(50))
通过这条语句
delete from test where convert(datetime,convert(nvarchar(50),logtime)) between '2009-06-21' and '2009-07-21'
只能删除这两个时间段内的记录
删除数据表中某个时间前的所有数据:
delete from 表名 where cast(字段名 as datetime)<'2009-07-21'
博客围绕数据表数据删除展开,提及要删除数据表中某个时间前的所有数据,还指出某条语句只能删除两个时间段内的记录。
5154

被折叠的 条评论
为什么被折叠?



