Jump to: navigation, search

Mysql RTRIM

From w3cyberlearnings

Contents

MySQL RTRIM Function

This function removes the trailling space. (Remove on the right for any whitespace)

Syntax RTRIM

  • Str: A given string
RTRIM(Str);

Example 1

mysql> SELECT RTRIM('go to  ');
+------------------+
| RTRIM('go to  ') |
+------------------+
| go to            |
+------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT RTRIM('go to  ') as 'go to', 'go to','go to   ';
+-------+-------+----------+
| go to | go to | go to    |
+-------+-------+----------+
| go to | go to | go to    |
+-------+-------+----------+
1 row in set (0.00 sec)

Related Links


Navigation
Web
SQL
MISC
References