代碼如下 復制代碼
mysql> select 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轉換字符串大小寫,因為這和其他數據庫中函數相兼容。