sql server - Stuff or Insert string before specific group of strings -
i have table containing data in historical table.
member_id colors 1 1) red 2) blue 3) green
i need modify or select data result-set looks this.
member_id colors 1 #1) red #2) blue #3) green
in nutshell insert pound before number , closing parenthesis.
i tried using charindex
have tried did not work.
assuming ms sql server... easiest way is: select member_id, replace(replace(replace(colors, '1', '#1'), '2', '#2'), '3', '#3') colors
Comments
Post a Comment