11.3.16 TRIM(substr FROM str)函数
TRIM(substr FROM str)函数用于删除字符串str首尾的子字符串substr,如果未指定substr,则默认删除空格。使用示例如下:
mysql> SELECT TRIM('hi' FROM 'hibinghehi'), TRIM(' binghe ');
+------------------------------+-------------------+
| TRIM('hi' FROM 'hibinghehi') | TRIM(' binghe ') |
+------------------------------+-------------------+
| binghe | binghe |
+------------------------------+-------------------+
1 row in set (0.00 sec)