开发者

mysql update script problem. all txt is lower case just first letter is upper case

This are my text in mysql datab开发者_如何学Case.

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?


something like this should work:

UPDATE `table` 
SET `field` = REPLACE(CONCAT(UPPER(LEFT(`field`, 1)), LOWER(SUBSTRING(`field`, 2))),' , ', ', ')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜