Skip to content
Advertisement

How to add split between duplicate value in SQL

I have SQL Server table that have duplicated value in field and need to split by slash character. All field start with alphabetical char end with ‘M’ char

For example:

and need to convert to:

Thanks

Advertisement

Answer

Probably many ways to skin this cat, assuming you’re always looking for the same initial character repeated within the string, the following uses stuff to insert a slash at the appropriate location:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement