网上的问题:
下面是Insus.NET的解决办法,仅供参考。
CREATE TABLE #temp([Source] NVARCHAR(100)) INSERT INTO #temp([Source]) VALUES ('2012-04-27 16:49:24$1$2'), ('2012-04-27 17:04:26$2$2'), ('2012-04-27 17:18:58$2$2926180') SELECT [Source], PARSENAME(REPLACE([Source],'$','.'),3) AS [日期], PARSENAME(REPLACE([Source],'$','.'),2) AS [考勤机号], PARSENAME(REPLACE([Source],'$','.'),1) AS [员工编号] FROM #temp
有关PARSENAME函数,这篇《函数PARSENAME使用和截取字符串》https://www.cnblogs.com/insus/p/10958452.html 。