TRIM Function
TRIM :
This function used to remove the particular string or char in prefixes or suffixes or both side in given input string.
Syntax:
TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str);
Example:
SET @string = TRIM(BOTH ‘,’ FROM REPLACE(CONCAT(”,” , ‘123,124,134′, “,”), CONCAT(”,”,’134′, “,”) , ‘,’));
select @string;
Output:
+————+
| @string |
+————+
| 123,124 |
+————+
