웹이야기

[MySQL] LOWER() 본문

D/MySQL

[MySQL] LOWER()

yeon.Biju 2020. 4. 14. 14:26

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)



 

'D > MySQL' 카테고리의 다른 글

[MySQL] LTRIM()  (0) 2020.04.14
[MySQL] LPAD()  (0) 2020.04.14
[MySQL] LOAD_FILE()  (0) 2020.04.14
[MySQL] LEFT()  (0) 2020.04.14
[MySQL] LCASE()  (0) 2020.04.13
Comments