Skip to content
Advertisement

Initcap of word

I’m having a table x it contain the column resource_name in this column I’m having data like NASRI(SRI). I’m applying initcap on this column it’s giving output Nasri(sri). But my expected output is Nasri(Sri). How I can achieve the desired result?

Thank you

Advertisement

Answer

One possible solution is to use split() with concat_ws(). If value does not contain ‘()’, then it will also work correctly. Demo with ():

And for value without () it also works good:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement