时间:2021-07-01 10:21:17 帮助过:27人阅读
--方法1 DECLARE @T int SET @T = 10455836 SELECT DATEADD(hour, (@T / 1000000) % 100, DATEADD(minute, (@T / 10000) % 100, DATEADD(second, (@T / 100) % 100, DATEADD(millisecond, (@T % 100) * 10, cast('00:00:00' AS time(2)))))) --方法2 SELECT CAST(STUFF(STUFF(STUFF(CAST(@T AS varchar),3,0,':'),6,0,':'),9,0,'.') AS time(2))
SQL Server time(2)类型存储为int后如何转换
标签:bar 类型转换 int mil false cond 保留 -- har