Home >Database >Mysql Tutorial >How to convert string to lowercase in mysql
In mysql, you can use the letter lowercase conversion function "LOWER(str)" to convert the letters in the string str to lowercase. The lower() function will return all characters mapped to lowercase according to the current character set, that is, return a lowercase string.
(Recommended tutorial: mysql video tutorial)
MySQL lowercase letter conversion function LOWER(str) can convert All alphabetic characters in the string str are converted to lowercase.
[Example] Use the LOWER function to convert all alphabetic characters in the string to lowercase. The input SQL statement and execution results are as follows.
mysql> SELECT LOWER('BLUE'),LOWER('Blue'); +---------------+---------------+ | LOWER('BLUE') | LOWER('Blue') | +---------------+---------------+ | blue | blue | +---------------+---------------+ 1 row in set (0.03 sec)
You can see from the results that all the letters were originally uppercase and were converted to lowercase, such as "BLUE". After conversion, it is "blue"; for a string of mixed uppercase and lowercase letters, the lowercase remains unchanged and the uppercase Letters are converted to lowercase letters, such as "Blue", which is converted to "bule".
The above is the detailed content of How to convert string to lowercase in mysql. For more information, please follow other related articles on the PHP Chinese website!