Need a MySQL query to update the customer first letter of the name is Capitalized and the remaining letters are lower case.
In cases where the Last name begins with the following: (Fitz, Mac, Mc, and O’) we should capitalize the following letter:
Example: McDonald, MacIntyre, O'Neal, etc.
SELECT CONCAT(UCASE(SUBSTRING(field, 1, 1)),LCASE(SUBSTRING(field, 2)))
FROM table_name WHERE field REGEXP BINARY '^[A-Z]+$';
I expect the output of to "mcdonald, macintyre, o'neal" be "McDonald, MacIntyre, O'Neal"