Home > Database > Mysql Tutorial > body text

MySQL字符串大小写转换函数

WBOY
Release: 2016-06-07 17:51:26
Original
1437 people have browsed it

MySQL字符串大小写转换需要用到MySQL字符串大小写转换函数,MySQL 字符串大小写转化函数有两对: lower(), uppper() 和 lcase(), ucase():

 

 代码如下 复制代码

>  lower('DDD');

+--------------+

| lower('DDD') |

+--------------+

| ddd |

+--------------+

mysql> select upper('ddd');

+--------------+

|upper('ddd') |

+--------------+

| DDD |

+--------------+

mysql> select lcase('DDD');

+--------------+

| lcase('DDD') |

+--------------+

| ddd |

+--------------+

mysql> select ucase('ddd');

+--------------+

| ucase('ddd') |

+--------------+

| DDD |

+--------------+ 

通常情况下,我选择 lower(), upper() 来实现MySQL转换字符串大小写,因为这和其他中函数相兼容。

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
Popular Tutorials
More>
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!