SQL ReferenceSQL 函数字符串函数TRIM本页总览TRIMtrimdescriptionSyntaxVARCHAR trim(VARCHAR str[, VARCHAR rhs])当没有rhs参数时,将参数 str 中右侧和左侧开始部分连续出现的空格去掉,否则去掉rhsexamplemysql> SELECT trim(' ab d ') str;+------+| str |+------+| ab d |+------+mysql> SELECT trim('ababccaab','ab') str;+------+| str |+------+| cca |+------+keywordsTRIM