user4166144
user4166144

Reputation: 251

MySQL: Update rows change case

I have a MySQL table with columns Forename, Surname.

These are all in uppercase but I want to re-format them for example:

Forename     |     Surname
--------------------------
John         |     Doe

rather than:

Forename     |     Surname
--------------------------
JOHN         |     DOE

Is it possible to do this on all rows via MySQL directly?

Upvotes: 0

Views: 45

Answers (1)

Mihai
Mihai

Reputation: 26784

UPDATE t
SET Forename= 
CONCAT((substr(Forename,1,1)), LOWER(substr(Forename,2))); 

Same for the other

Upvotes: 1

Related Questions