摘要:
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 阅读全文
摘要:
求时间字段与输入时间点的时间差j绝对值,最后取最小时间差 SELECT min(ABS(DATEDIFF(MILLISECOND,'2019-12-18 14:11:00.000' ,s.Time))) AS diff FROM EnergyConsumptions AS s 阅读全文