개인적인 정리

[Oracle]RTRIM() 본문

DB/ORACLE

[Oracle]RTRIM()

yeon.Biju 2020. 6. 11. 13:54

오라클 RTRIM()

 

RTRIM()

   -

 

RTRIM(char, set)

의 형태

 

RTRIM removes from the right end of char all of the characters that appear in set. This function is useful for formatting the output of a query.

 

If you do not specify set, then it defaults to a single blank. If char is a character literal, then you must enclose it in single quotation marks. RTRIM works sililarly to LTRIM.

 

Both char and set can be any of the data types CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB or NCLOB. The string returned os of VARCHAR2 data type if char is a character data type, NVARCHAR2 if char is a national character data type, and a LOB if char is a LOB data type.

 

SQL> SELECT RTRIM('<=====>BROWING<======>', '<>=') FROM DUAL;
   ---> <=====>BROWING


SQL> SELECT RTRIM('<=====>BROWING<======>', '>') FROM DUAL;
   ---> <=====>BROWING<======


SQL> SELECT RTRIM('ABCDEF', '') FROM DUAL;

   ---> 

SQL> SELECT RTRIM('ABCDEF', 'F') FROM DUAL;

   ---> ABCDE

'DB > ORACLE' 카테고리의 다른 글

[ORACLE] NULL 치환 - NVL  (0) 2021.07.28
오라클 컬럼 이름 변경  (0) 2021.02.19
[Oracle]RPAD()  (0) 2020.06.11
[Oracle]ROW_NUMBER()  (0) 2020.06.11
[Oracle]ROUND(number)  (0) 2020.06.10
[Oracle]ROUND(date)  (0) 2020.06.10
[Oracle]REPLACE()  (0) 2020.06.10
[Oracle]REMAINDER()  (0) 2020.06.10
Comments