I have lowercase strings separated by spaces and I want the first letter of the string plus each letter that comes after a space to be capitalized when doing the select.
Example: I have the string 'Puerto Rico' in a field, and when doing the select I want it to be displayed like this: Puerto Rico
I am using version 8.0.30
As such, in MySQL there is no way - like in Oracle, for example - in which the first letter of each word can be capitalized, however, on the internet you can find endless functions that replicate the operation of the
INITCAP
de Oracle (basically it's the function that does what you're looking for, but in this DBMS).One of the functions I found is the following:
It is checked as follows:
I leave you two links:
Greetings.