How to Eliminate Ugly Nested REPLACE() Functions
Bert Wagner
212

I’ve done it like this:

REPLACE(REPLACE(REPLACE(REPLACE(
c.Colors
,'Red','R')
,'Green','G')
,'Blue','B')
,', ','') AS Colors

You can lose track of all the replaces but MSSM will let me know if I missed something.

I like your solution too though!

Like what you read? Give Jon Nyman a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.