How to convert string to lowercase in mysql

青灯夜游
Release: 2020-10-20 16:22:39
Original
4325 people have browsed it

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.

How to convert string to lowercase in mysql

(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)
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!