MySQL trim function

MySQL TRIM() function returns a string after removing all prefixes or suffixes from the given string.


TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM ] str)


BOTHIndicates that prefixes from both left and right are to be removed.
LEADINGIndicates that only leading prefixes are to be removed.
TRAILINGIndicates that only trailing prefixes are to be removed.
remstrThe string to be removed.
strThe actual string from where remstr is to be removed.


mysql> SELECT TRIM(' trim '); 
| trim           | 
1 row in set (0.00 sec)

Satya Prakash

VOIP Expert: More than 8 years of experience in Asterisk Development and Call Center operation Management. Unique Combination of Skill Set as IT, Analytics and operation management.

Leave a Reply