Description
RTRIM strips the trailing blanks from a string expression, and returns the string as type VARCHAR. If string-expression is NULL, RTRIM returns NULL. If string-expression is a string consisting entirely of blank spaces, RTRIM returns the empty string ('').
RTRIM always returns data type VARCHAR, regardless of the data type of the input expression to be trimmed.
RTRIM leaves leading blanks; to remove leading blanks, use LTRIM. To remove leading and/or trailing characters of any type, use TRIM. To pad a string with trailing blanks or other characters, use RPAD. To create a string of blanks, use SPACE.
Note that RTRIM can be used as an ODBC scalar function (with the curly brace syntax) or as an SQL general function.