웹이야기

[MySQL] REPLACE() 본문

D/MySQL

[MySQL] REPLACE()

yeon.Biju 2020. 4. 20. 12:09

MySQL 문자열 함수와 연산자

 

REPLACE()

   - 문자열 치환

 

REPLACE(str, from_str, to_str)

의 형태

 

Returns the string str with all occurences of the string from_str replaced by string to_str. REPLACE() performs a case-sensitive match when searching for from_str.

 

mysql> SELECT REPLACE('오늘은 검색 오늘은', '오늘은', '내일은');
+-----------------------------------------------------------------+
| REPLACE('오늘은 검색 오늘은', '오늘은', '내일은')               |
+-----------------------------------------------------------------+
| 내일은 검색 내일은                                              |
+-----------------------------------------------------------------+
1 row in set (0.00 sec)

 

This function is multibyte safe.

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

[MySQL] RIGHT()  (0) 2020.04.20
[MySQL] REVERSE()  (0) 2020.04.20
[MySQL] REPEAT()  (0) 2020.04.20
[MySQL] QUOTE()  (0) 2020.04.20
[MySQL] POSITION()  (0) 2020.04.20
Comments