Capitalize first letter in mysql

by Ramya 2009-11-04 18:23:54

Capitalize first letter in mysql:

To make first letter capital in mysql use the following format:

UPDATE tablename SET
FieldName = CONCAT(UPPER(LEFT(FieldName,1)),SUBSTRING(FieldName FROM 2));


For eg,

update table1 set
name1= CONCAT(UPPER(LEFT(name1, 1)), SUBSTRING(name1 FROM 2));


Now there is no need to change the field name individually to capitalize first letter in mysql.
Hence it saves time to make first letter capital in mysql using a single query.

Tagged in:

2654
like
0
dislike
0
mail
flag

You must LOGIN to add comments