Trims spaces from the end of a string value.

Syntax

RTRIM(expression)

Arguments

  • expression: a character expression of one of these types, or an expression that resolves to one of these types:
    • CHAR
    • VARCHAR
    • LONG VARCHAR

Returns

  • The same type as the input expression.

  • NULL if expression evaluates to NULL.

Examples

SELECT firstName, RTRIM(firstName) AS firstNameTrim FROM MYSQL.inventory.cust;

VALUES RTRIM('John Smith  ');
-- Returns John Smith