I have one input string 'abcdefg,,,,,,,ghijk,,,,,lmno' and we want an output of 'abcdefg,ghijk,lmno' in SQL Server.
Asked
Active
Viewed 131 times
1 Answers
1
Based on this solution you can replace multiple , with a single , like this:
SELECT REPLACE(REPLACE(REPLACE('abcdefg,,,,,,,ghijk,,,,,lmno', ',', '<>'), '><', ''), '<>', ',')
Sebastian Brosch
- 39,662
- 14
- 68
- 78