This tutorial explains how to use the MySQL RTRIM function with syntax and examples.
The MySQL RTRIM function removes all space characters from the right-hand side of a string.
The syntax for the RTRIM function in MySQL is:
RTRIM( string )
The string to trim the space characters from the right-hand side.
The RTRIM function can be used in the following versions of MySQL:
Let's look at some MySQL RTRIM function examples and explore how to use the RTRIM function in MySQL.
For example:
mysql> SELECT RTRIM('Tech on the net ');
Output: 'Tech on the net'
mysql> SELECT RTRIM(' Tech on the net ');
Output: ' Tech on the net'
mysql> SELECT RTRIM('AODBA.com ');
Output: 'AODBA.com'