일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 방화벽
- Data and Time Functions
- 티베로
- Oracle
- Tibero
- 전자정부 표준프레임워크
- Sring Functions and Operators
- 오라클
- String Functions and Operators
- MySQL
- 전자정부표준프레임워크
- String Functions and Date Operators
- Date and Time Function
- SVN
- String Function and Operators
- HTTP
- 윈도우
- Date and Time Functions
- Today
- Total
웹이야기
[MySQL]TRIM() 본문
MySQL 문자열 함수와 연산자
TRIM()
-
TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str)
TRIM([remstr FROM] str)
의 형태
Returns the string str with all remstr prefixes or suffixes removed. If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr is optional and, if not specified, spaces are removed.
mysql> SELECT TRIM(' bar ');
+-------------------+
| TRIM(' bar ') |
+-------------------+
| bar |
+-------------------+
1 row in set (0.00 sec)
mysql> SELECT TRIM(LEADING 'x' FROM 'xxxbarxxx') ;
+------------------------------------+
| TRIM(LEADING 'x' FROM 'xxxbarxxx') |
+------------------------------------+
| barxxx |
+------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TRIM(BOTH 'x' FROM 'xxxbarxxx') ;
+---------------------------------+
| TRIM(BOTH 'x' FROM 'xxxbarxxx') |
+---------------------------------+
| bar |
+---------------------------------+
1 row in set (0.01 sec)
mysql> SELECT TRIM(TRAILING 'x' FROM 'xxxbarxxx') ;
+-------------------------------------+
| TRIM(TRAILING 'x' FROM 'xxxbarxxx') |
+-------------------------------------+
| xxxbar |
+-------------------------------------+
1 row in set (0.00 sec)
This function is multibyte safe.
'D > MySQL' 카테고리의 다른 글
[MySQL]UNHEX() (0) | 2020.06.18 |
---|---|
[MySQL]UCASE() (0) | 2020.06.18 |
[MySQL]SUBSTRING_INDEX() (0) | 2020.06.11 |
[MySQL]SUBSTR() (0) | 2020.06.11 |
[MySQL]SPACE() (0) | 2020.06.11 |