Blog

UpperCase First Letter no MySQL

Precisei normalizar alguns dados que estavam todos com a letra em maiúscula, em vez de conectar com o PHP e usar ucfirst(); pesquisei e fiz direto no banco.

Equivalente ao ucfirst do PHP no MySQL.

1
UPDATE [table] SET [field] = CONCAT(UPPER(LEFT(LOWER([field]), 1)), SUBSTRING(LOWER([field]), 2));

Related posts:

  1. Gerenciadores MySQL gratuito para uso comercial

Um Comentário

Got something to say? Feel free, I want to hear from you! Deixe seu Comentário

  1. Muito bom seu menino!

Deixe seu Comentário

Let us know your thoughts on this post but remember to place nicely folks!