Home  >  Article  >  Database  >  MySQL字符串大小写转换函数

MySQL字符串大小写转换函数

WBOY
WBOYOriginal
2016-06-07 17:51:261423browse

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转换字符串大小写,因为这和其他中函数相兼容。

Statement:
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