Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 835 Bytes

File metadata and controls

35 lines (27 loc) · 835 Bytes
description
Removes trailing spaces or characters from a string.

RTRIM

Syntax

RTRIM(expression varchar, trim_expression varchar) → varchar

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

Examples

{% code title="RTRIM example" %}

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

{% endcode %}

{% code title="RTRIM example" %}

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

{% endcode %}

{% code title="RTRIM example" %}

SELECT RTRIM('spice   ')
-- spice

{% endcode %}