- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What MySQL TRIM() function returns if 1st argument(i.e. BOTH, LEADING, TRAILING) is not specified?
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.
- Related Articles
- What MySQL returns if the argument of QUOTE() function is NULL?
- What MySQL returns if the first argument of INTERVAL() function is NULL?
- What MySQL EXPORT_SET() function returns if any of the argument is NULL?
- What MySQL returns if we use UNIX_TIMESTAMP() function with no argument?
- What MySQL COALESCE() function returns if it has a blank, but not NULL, as the first argument?
- What MySQL returns if the search string is not in the list of strings provided as argument in FIELD() function?
- Trim (Remove leading and trailing spaces) a string in C#
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- Trim a string in Java to remove leading and trailing spaces
- What happens with the output of MySQL EXPORT_SET() function if I will skip both 4th and 5th argument i.e. separator and number of bits?
- What MySQL returns if we use NULL, as both the arguments, as one of the argument and as a separator, in CONCAT_WS() function?
- What MySQL ELT() function returns if we the index number, provided as an argument, is less than 1?
- What MySQL returns if I provide a non-hexadecimal number as an argument to UNHEX() function?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- What MySQL returns if specified format string is not as per accordance with the date string passed as arguments to STR_TO_DATE() function?

Advertisements