I've found this solution, but never tested :
-- Input: Red, Blue, Green
-- Output: RGB
SELECT
s.Colors
FROM
(SELECT 'Red, Green, Blue' AS Colors) c
CROSS APPLY (SELECT REPLACE(c.Colors,'Red','R') AS Colors) r
CROSS APPLY (SELECT REPLACE(r.Colors,'Green','G') AS Colors) g
CROSS APPLY (SELECT REPLACE(g.Colors,'Blue','B') AS Colors) b
CROSS APPLY (SELECT REPLACE(b.Colors,', ','') AS Colors) s
Watch this week's video on YouTube How many times have you had to transform some column value and ended up stacking several nested SQL REPLACE()...