trim

description

Syntax

VARCHAR trim(VARCHAR str[, VARCHAR rhs])

当没有rhs参数时,将参数 str 中右侧和左侧开始部分连续出现的空格去掉,否则去掉rhs

example

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

keywords

  1. TRIM