The usage of trim () function
In oracle, the use of the trim () function is the beginning of leading, the end of trailing, the beginning and end of both, as follows:
Trim (leading | | trailing | | both 'character to be replaced "from" string to be replaced ")
1. The trim function removes the specified opening character.
Select trim (leading 'x' from 'xday') as strTemp from tableName
2. The trim function removes the specified ending character.
Select trim (trailing 'x' from 'dayx') as strTemp from tableName
3. The trim function removes the specified leading and trailing characters
Select trim (both 'x' from 'xdayx') as strTemp from tableName
4. By default, the trim function removes the characters specified by the header and trailer.
Select trim ('x 'from' xdayx') as strTemp from tableName
5. If no character is specified to be removed, the leading and trailing spaces will be removed by default
Select trim ('day') as strTemp from tableName