Skip to main content
Version: 0.0.1

RTRIM

Categories: String

RTRIM

Removes trailing spaces or characters from a string.

Syntax

RTRIM(expression varchar [, trim_expression varchar]) → varchar

  • expression: The expression to be trimmed.
  • trim_expression (optional): Trailing characters to trim. If this parameter is not specified, then spaces will be trimmed from the input expression.

Examples

{{< codeheader "RTRIM example" >}}

SELECT RTRIM('pancake', 'cake')
-- pan

{{< codeheader "RTRIM example" >}}

SELECT RTRIM('pancake pan', 'abnp')
-- pancake

{{< codeheader "RTRIM example" >}}

SELECT RTRIM('dremio   ')
-- dremio