Reputation: 3953
This are my text in mysql database.
Otok Pasman, Kraj
Otok pasman,Kraj
Otok Pasman , Kraj
Otok pasman, Kraj
Otok PASMAN, Kraj
How can i automatically change all rows to lower case, first letter must be upper case and " , " is always ", "?
so like this:
Otok Pasman, Kraj
and all other text in database like this example?
Upvotes: 2
Views: 425
Reputation: 1564
something like this should work:
UPDATE `table`
SET `field` = REPLACE(CONCAT(UPPER(LEFT(`field`, 1)), LOWER(SUBSTRING(`field`, 2))),' , ', ', ')
Upvotes: 2