rtrim

description

Syntax

VARCHAR rtrim(VARCHAR str[, VARCHAR rhs])

When the ‘rhs’ parameter is not present, remove the continuous spaces that appear from the ending of the ‘str’ parameter. Otherwise, remove ‘rhs’.

example

  1. mysql> SELECT rtrim('ab d ') str;
  2. +------+
  3. | str |
  4. +------+
  5. | ab d |
  6. +------+
  7. mysql> SELECT rtrim('ababccaab','ab') str;
  8. +---------+
  9. | str |
  10. +---------+
  11. | ababcca |
  12. +---------+

keywords

  1. RTRIM