How to modify the MySQL field to capitalize the first letter: First, use LEFT to remove the first letter separately and use UPPER to capitalize it; then determine the length of the field, and use SBUSTRING to remove all fields from the second to the end for later use; then Use CONCAT to connect the two values above; finally, the value of the update table field can be modified.
【Related learning recommendations: mysql tutorial(Video)】
How to modify the MySQL field to capitalize the first letter:
Explanation function:
##CONCAT( str1, str2)Character concatenation function
UPPER(str)Change the string to uppercase letters
LOWER(str)Change the string to lowercase letters
LENGTH(str)Determine the length of the string
SUBSTRING(str,a,b)Extract a section of the field, starting from the a-th position of the string str, and extracting b characters
LEFT(str,n)Extract the leftmost n characters of the string
RIGHT(str,n)Extract characters The rightmost n characters of the string
If you want to know more about programming learning, please pay attention to thephp training column!
The above is the detailed content of How to modify MySQL fields to capitalize the first letter. For more information, please follow other related articles on the PHP Chinese website!