MySQL: RTRIM Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL RTRIM Function

In this guide, we will explain how to use the MySQL RTRIM function with syntax and examples.

Description

The MySQL RTRIM function removes all space characters from the right-hand side of a string.

Syntax

The syntax for the RTRIM function is:

RTRIM( string )

Parameters or Arguments

string

The string to trim the space characters from the right-hand side.

Applies To

The RTRIM function can be used in the following versions of :

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let’s look at some RTRIM function examples and explore how to use the RTRIM function.

For example:

mysql> SELECT RTRIM('Ad gl o b    ');
Result: 'Ad gl o b'

mysql> SELECT RTRIM('   Ad   gl   o   b    ');
Result: '   Ad   gl   o   b'

mysql> SELECT RTRIM('adglob.in    ');
Result: 'adglob.in'

Next Topic : Click Here

This Post Has One Comment

Leave a Reply