MYSQL: set first letter of field to uppercase

Submit to reddit

I recently had to set values of a set of values from a column from lowercase to Firstuppercase. Nothing easier, run the following code on the database:

UPDATE `affected_table` SET
`field_in_question` = CONCAT(UPPER(LEFT(`field_in_question`, 1)),
SUBSTRING(`field_in_question`, 2));
  • Thanks.
    Simple but efficient.
    exactly what i was looking for !

  • Thanks for your help.

  • ramprasad

    i need for entire colums