我有表A,需要得到如表B所示的结果。
Table A
S.no Name
1 xy rz Jr
2 yz re Sr
3 yr, rq, Sr.
Table B
S.no Name
1 xy, rz, Jr.
2 yz, re, Sr.
3 yr, rq, Sr.
我最初尝试删除特殊字符,然后在后期合并但我无法以所需的输出格式排列
答案 0 :(得分:0)
这是我的解决方案:
1-尝试对您的列应用转换以清除特殊字符(例如'。',','):
REPLACE(
REPLACE( @[User::val3_]
,","
,"")
,"."
,"")
2-然后,您可以应用此代码来转换列:
@[User::val]+"------"+
(LEFT(@[User::val],2)+", ")
+
(LEFT(
TRIM(
REPLACE(@[User::val]
,(LEFT(@[User::val],2))
,"") )
,2)+", ")
+
(LEFT(
TRIM(
REPLACE(TRIM( REPLACE(@[User::val],LEFT(@[User::val],2),"") )
,(LEFT(
TRIM(REPLACE(@[User::val],(LEFT(@[User::val],2)),"") )
,2))
,"") )
,2)+".")
我希望这会对你有所帮助。
祝你好运