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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -