Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

RTRIM Function


The RTRIM function removes specified characters from the right-hand side of a string.


RTRIM( string [, trim_string])


string :

character string

string valued column



trim_string :

character string


  • string : Enters a string or string-type column to trim. If this value is NULL, NULL is returned.
  • trim_string : You can specify a specific string to be removed in the right side of string. If it is not specified, empty characters (' ') is automatically specified so that the empty characters in the right side are removed.

SELECT RTRIM ('     Olympic     ');

 rtrim('     Olympic     ')


  '     Olympic'


--If NULL is specified, it returns NULL

SELECT RTRIM ('iiiiiOlympiciiiii', NULL);

 rtrim('iiiiiOlympiciiiii', null)




-- trimming specific strings on the right

SELECT RTRIM ('iiiiiOlympiciiiii', 'i');

 rtrim('iiiiiOlympiciiiii', 'i')