RTRIM
removes trailing spaces from an input string.
To remove leading spaces use the LTRIM function.
To remove both leading and trailing spaces use the TRIM function.
The example removes the trailing spaces from the input string.
SELECT RTRIM('SQL ') AS 'Right Trimmed'
Right Trimmed |
---|
SQL |
Syntax of the RTRIM function.
RTRIM(string)
string
-- a character expression, variable, or column name.