Skip to content

RTRIM

功能描述

将VARCHAR或CHAR类型的字段或表达式尾部空格去掉。

语法格式

RTRIM(expr1,[expr2])

参数说明

  • expr1:字串表达式或字段
  • expr2:字串表达式或字段

函数返回类型

CHAR类型字符串

示例

sql
SQL> SELECT RTRIM('asd ') FROM dual;

EXPR1 | 
------------------------------------------------------------------------------
asd|

SQL> SELECT RTRIM('a s d ') FROM dual;

EXPR1 | 
------------------------------------------------------------------------------
a s d|

SQL> SELECT RTRIM('asd','d') FROM dual;

EXPR1 | 
------------------------------------------------------------------------------
as|

SQL> SELECT RTRIM('asd ','d ') FROM dual;

EXPR1 | 
------------------------------------------------------------------------------
as|

SQL> SELECT RTRIM('asd ','d') FROM dual;

EXPR1 | 
------------------------------------------------------------------------------
asd |