## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> RTRIM[RTRIM]:::quoted RTRIM --> End((END)) ``` ## Purpose The `RTRIM` SQL function trims characters from the right side of a text. See also [[LTRIM]] and [[TRIM]]. Parameters: - Input (`varchar2`): the text from which to trim characters from the right side. - Characters to trim (optional, `varchar2`): the character to trim. Defaults to a space (`' '`). Returns: A text with characters trimmed from the right. ## Examples The following example trims the trailing space from `abcd `: ```sql select rtrim('abcd ') ------------------- abcd ``` The following example trims all characters `c`, `d` and `b` from the right side of `abcd`: ```sql select rtrim('abcd', 'cdb') ------------------- a ``` The following example trims all digits from the right side of `abcd1029384756`: ```sql select rtrim('abcd1029384756', '0123456789') ------------------- abcd ```