[MySQL] LOWER()
MySQL 문자열 함수와 연산자
LOWER()
-
LOWER(str)
의 형태
Returns the string str with all characters changed to lowercase according to the current character set mapping. The default is utf8mb4. (MySQL 8. x 버전 이상부터 일 것이다.)
mysql> SELECT LOWER('ABCD') ;
+---------------+
| LOWER('ABCD') |
+---------------+
| abcd |
+---------------+
1 row in set (0.00 sec)
LOWER() (and UPPER()) are ineffective when applied to binary strings(BINARY, VARBINARY, BLOB). To perform lettercase conversion of a binary string, first convert it to a nonbinary string using a character set appropriate for the data stored in the string :
mysql> SET @str = BINARY 'New York';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING utf8mb4)) ;
+-------------+------------------------------------+
| LOWER(@str) | LOWER(CONVERT(@str USING utf8mb4)) |
+-------------+------------------------------------+
| New York | new york |
+-------------+------------------------------------+
1 row in set (0.00 sec)