I need to capitalize the first letter of certain words in my SQL qwery in Snowflake.
I am currently using this function:
SELECT ...
case when FLAG1 is null then upper(FLAG2) else FLAG1 END as STATUS,
...;
The UPPER() function however renders all my FLAG2 words to be fully capitalized. Anyone know how to capitalize the first letter of words in Snowflake?
Use initcap() function, it returns the input string (expr) with the first letter of each word in uppercase and the subsequent letters in lowercase.
If you want only first letter in a string to be capitalized, ignoring word delimiters (i.e. the input expression is treated as a single, continuous word), specify empty string as delimiters parameter
INITCAP( str, '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With