Is it possible in mysql to format a column in Proper Case?
Example: Proper("ABSALOM") = "Absalom"
I have searched a lot and I think MySQL doesn't have any inbuilt function to do this. Is it possible to do this any other way in MySQL?
NOTE you would have to use this as you would have to use it as.... SELECT dbo. ProperCase(LOWER(column)) since the column is in uppercase.
Actually, there is no single function in MySQL to capitalize only first letter of the string. We need to use nesting of functions and for this case, we can use UPPER() and LOWER() with SUBSTRING() functions.
You can combine CONCAT and SUBSTRING:
CONCAT(UCASE(SUBSTRING(`fieldName`, 1, 1)), LOWER(SUBSTRING(`fieldName`, 2)))
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