1 min read

Redshift Tricks

Split PascalCase string to individual words

SELECT REGEXP_REPLACE('SmilingFaceWithOpenMouthAndColdSweat', '\\B([A-Z][^A-Z]*)', ' $1');
-- Smiling Face With Open Mouth And Cold Sweat

Source: adopted for Redshift from this StackOverflow answer