RTRIM()

Overview

Returns a string with certain trailing characters removed.

USAGE

RTRIM(string[, trim])

Argument Name

Description

string

The string to trim

trim

Optional. The string of characters to trim. Defaults to a space

DETAILS

RTRIM() is a string function that returns a string with certain trailing characters removed.

If the trim argument is not specified, one or more spaces are removed from the end of the string and the resulting value is returned.

If the trim argument is not specified, one or more instances of trim are removed from the end of the string and the resulting value is returned.

A NULL is returned if either argument is NULL.

  • The ISO 9075:2016 standard does not discuss RTRIM() function, but does discuss string value functions:

    • For additional information on the standard, see ISO/IEC 9075-2:2016, 6.32 <string value function>

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT QUOTE(RTRIM(' abc   ')) AS result;
+--------+
| result |
+--------+
| ' abc' |
+--------+
SELECT RTRIM('abc.....', '..') AS result;
+--------+
| result |
+--------+
| abc.   |
+--------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES