在SQL Server2008中:表Table_1的数据
tid ttime tvalue
3 2010-02-07 00:51:16.043 3
4 2010-02-07 00:51:21.910 4用以下sql查询:
select * from Table_1 as t
where t.ttime>N'2010-02-07 00:51:16.042'
order by t.ttime结果得到以下结果:
tid ttime tvalue
4 2010-02-07 00:51:21.910 4不是应该得到tid为3的这条记录吗?
tid ttime tvalue
3 2010-02-07 00:51:16.043 3
4 2010-02-07 00:51:21.910 4用以下sql查询:
select * from Table_1 as t
where t.ttime>N'2010-02-07 00:51:16.042'
order by t.ttime结果得到以下结果:
tid ttime tvalue
4 2010-02-07 00:51:21.910 4不是应该得到tid为3的这条记录吗?
在sql server的帮助里有这么一句话:
精确度: 舍入到 .000、.003 或 .007 秒三个增量。
DECLARE @D DATETIME
SET @D = '2010-02-07 00:51:16.042'
SELECT @D
--结果
--2010-02-07 00:51:16.043