且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将 varchar 转换为时间

更新时间:2023-02-03 16:54:08

字符串格式错误.它应该是 09:47:11.895799.您需要将最后的 : 替换为 .

The string is in the wrong format. It should be 09:47:11.895799. You need to replace the final : with a .

SELECT CAST(STUFF('09:47:11:895799', 9,1,'.') AS TIME)