sql server - How to reverse values in a string in T-SQL -
using t-sql, i'm trying find easiest way make:
"abc.def.ghi/jkl" become "abc/def/ghi.jkl"?
basically switch . , /
thank you
one way
select replace(replace(replace('abc.def.ghi/jkl','/','-'),'.','/'),'-','.')
you need use intermediate step, chose - symbol, choose won't exist in string
Comments
Post a Comment