如何将字符串 20131224080910 转换成 2013-12-24:08:09:10 ?
declare @s varchar(32) SET @s = N'20131224080910' select SUBSTRING(@s, 1,4) +'-'+ SUBSTRING(@s,5,2) +'-'+ SUBSTRING(@s, 7,2)+ ':'+SUBSTRING(@s, 9,2)+ ':'+SUBSTRING(@s, 11,2)+ ':'+SUBSTRING(@s, 13,2)
如何将字符串 20131224080910 转换成 2013-12-24:08:09:10 ?
declare @s varchar(32) SET @s = N'20131224080910' select SUBSTRING(@s, 1,4) +'-'+ SUBSTRING(@s,5,2) +'-'+ SUBSTRING(@s, 7,2)+ ':'+SUBSTRING(@s, 9,2)+ ':'+SUBSTRING(@s, 11,2)+ ':'+SUBSTRING(@s, 13,2)