TRIM FUNCTIONS
Returns the string str with all remstr prefixes or suffixes removed.
Syntax
TRIM(expr);
LTRIM(expr);
RTRIM(expr);
Examples
SELECT TRIM(' aaa ');
+-------------------+
| trim(' aaa ') |
+-------------------+
| aaa |
+-------------------+
SELECT LTRIM(' aaa ');
+--------------------+
| LTRIM(' aaa ') |
+--------------------+
| aaa |
+--------------------+
SELECT RTRIM(' aaa ');
+--------------------+
| RTRIM(' aaa ') |
+--------------------+
| aaa |
+--------------------+