What MySQL TRIM() function returns if 1st argument(i.e. BOTH, LEADING, TRAILING) is not specified?

MySQLMySQLi Database

By default MySQL will assume the argument BOTH if the 1st argument is not specified in TRIM() function. Following example will demonstrate it.

Example

mysql> SELECT TRIM('A' FROM 'ABCDAEFGAA');
+-----------------------------+
| TRIM('A' FROM 'ABCDAEFGAA') |
+-----------------------------+
| BCDAEFG                     |
+-----------------------------+
1 row in set (0.00 sec)

The above result set shows that when we did not specify 1st argument then MySQL returns the output by assuming BOTH as the 1st argument of TRIM() function.

raja
Published on 20-Feb-2018 09:57:41
Advertisements