我有一个像“Telugu,Praveen Kumar”这样的字符串。我需要像 First_Name = Praveen、Last_Name= Telugu、Middle_Name= Kumar 一样拆分这个字符串。请帮帮我!!!
问问题
94 次
1 回答
0
试试这个:
UPDATE table
SET FirstName = SUBSTRING(FullName, CHARINDEX(',', FullName)+1, CHARINDEX(' ',FullName)-CHARINDEX(',', FullName)-1)
,MiddleName = SUBSTRING(FullName, 0, CHARINDEX(',', FullName))
,LastName = SUBSTRING(FullName, CHARINDEX(' ', FullName)+1, LEN(FullName)-CHARINDEX(' ', FullName)+1)
于 2017-10-06T10:57:01.370 回答