delete 如何删除指定 日期时间 如日期为 2013-08-23 08:27:26表为tmpTRecords delete from tmpTRecords where sign_time后面怎么写 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delete from tmpTRecords where sign_time='2013-08-23 08:27:26' delete from tmpTRecords where sign_time like '2013-08-23 08:27:26%' delete from tmpTRecords where sign_time between '2013-08-23 08:27:26.000' AND '2013-08-23 08:27:26.999' 需要格式化日期:delete from tmpTRecords where convert(varchar(10),sign_time,120)='2013-08-20' 函数convert()可以格式化日期多种格式应该:delete from tmpTRecords where convert(varchar(19),sign_time,120)=2013-08-23 08:27:26' delete from tmpTRecords where convert(varchar(19),sign_time,120)=2013-08-23 08:27:26' --先SELECT出来,确认没问题了,再删除SELECT * from tmpTRecords where sign_time >= '2013-08-23 08:27:26'AND sign_time < '2013-08-23 08:27:27' 一般存储时间为datetime是到毫秒的,所以删除可以这样写delete from [表名] where sign_time='2013-08-23 08:27:26.000'当如正如8楼的说的你要删除某条记录首先要用Select能查出来 如何学习SQL 多行数据转成一行数据 这个SQL能优化吗? 解析SQL查询时生成的临时文件 SQL2000在win2003和XP中文版下不同的排序结果(同样的数据库和排序规则) 大侠一定要救助下我,和动态SQL有关,小弟调了一天这个存储过程都还是有错误,根本没法往下搞了 如何约束一个表中的两列必须有一列不为空? 关于时间段的求和 关于简繁体字问题。。。。。。 如何将数据*.mdf文件导入到sql数据库 sql怎么样删除表中指定字段以外的所有字段? sql 语句问题,老师帮一下忙!
delete from tmpTRecords where convert(varchar(10),sign_time,120)='2013-08-20'
应该:
delete from tmpTRecords where convert(varchar(19),sign_time,120)=2013-08-23 08:27:26'
delete from tmpTRecords where convert(varchar(19),sign_time,120)=2013-08-23 08:27:26'
SELECT * from tmpTRecords
where sign_time >= '2013-08-23 08:27:26'
AND sign_time < '2013-08-23 08:27:27'
delete from [表名] where sign_time='2013-08-23 08:27:26.000'
当如正如8楼的说的你要删除某条记录首先要用Select能查出来