📅  最后修改于: 2020-11-21 13:43:57             🧑  作者: Mango
trim()是MySQL的String函数。此函数从给定字符串的开头和结尾删除空格。
TRIM( [ LEADING | TRAILING | BOTH ] [ trim_character FROM ] string )
str:要修剪的字符串
前导:它从字符串的开头删除空格
训练:它删除字符串末尾的空格
两者:删除字符串开头和结尾的空格
Select trim(' javatpoint ');
输出:
Select trim(leading 'mysql' from 'mysql_javatpoint ');
输出:
Select trim(both 'mysql' from 'mysql_javatpoint_mysql');
输出:
Select trim(trailing 'mysql' from 'javatpoint_mysql');
输出: