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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -