Oracle字符串操作-TRIM的3个参数BOTH,LEADING,TRAILING

1. 去掉两边的字符
SQL> SELECT TRIM(BOTH 'O' FROM 'OOHELLO') FROM dual;
TRIM
----
HELL

2. 去掉左边的字符
SQL> SELECT TRIM(LEADING 'O' FROM 'OOHELLO') FROM dual;
TRIM(
-----
HELLO

3. 去掉右边的字符
SQL> SELECT TRIM(TRAILING 'O' FROM 'OOHELLO') FROM dual;
TRIM(T
------
OOHELL
SQL> 

你可能感兴趣的:(oracle,trim)