摘要: with T1 as ( SELECT ROW_NUMBER() over (PARTITION By MachineCode order by ABS(DATEDIFF(MILLISECOND,'2019-12-10 13:21:32.162' ,[Time]))) as rowid,* FROM 阅读全文
posted @ 2020-05-21 17:19 も不秃不秃 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: 求时间字段与输入时间点的时间差j绝对值,最后取最小时间差 SELECT min(ABS(DATEDIFF(MILLISECOND,'2019-12-18 14:11:00.000' ,s.Time))) AS diff FROM EnergyConsumptions AS s 阅读全文
posted @ 2020-05-21 15:35 も不秃不秃 阅读(913) 评论(0) 推荐(0) 编辑