To jest zapytanie, które działa:
SELECT
CONCAT(
UPPER(SUBSTRING(Name,1,1)),
LOWER(SUBSTRING(Name,2,Locate(' ', Name)-1)),
UPPER(SUBSTRING(Name,Locate(' ', Name)+1,1)),
LOWER(SUBSTRING(Name,Locate(' ', Name)+2)))
FROM NameTable;
Oto wynik:
Name
Firstname Lastname
Firstname Lastname
Firstname Lastname
Firstname Lastname
Aby AKTUALIZOWAĆ użycie kolumny,
UPDATE NameTable
SET NameTable.Name = CONCAT(
UPPER(SUBSTRING(Name,1,1)),
LOWER(SUBSTRING(Name,2,Locate(' ', Name)-1)),
UPPER(SUBSTRING(Name,Locate(' ', Name)+1,1)),
LOWER(SUBSTRING(Name,Locate(' ', Name)+2)));
Pozdrawiam