Syntax\n------\n\nTRIM_ORACLE([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str)\n\nDescription\n-----------\n\nReturns the string str with all remstr prefixes or suffixes removed. If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr is optional and, if not specified, spaces are removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either an empty string, or, with SQL_MODE=Oracle, NULL. SQL_MODE=Oracle is not set by default.\n\nThe Oracle mode version of the function can be accessed in any mode by using TRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT TRIM('  bar   ')\\G\n************************ 1. row *********************\nTRIM('  bar   '): bar\n\nSELECT TRIM(LEADING 'x' FROM 'xxxbarxxx')\\G\n********************* 1. row *********************\nTRIM(LEADING 'x' FROM 'xxxbarxxx'): barxxx\n\nSELECT TRIM(BOTH 'x' FROM 'xxxbarxxx')\\G\n********************* 1. row *********************\nTRIM(BOTH 'x' FROM 'xxxbarxxx'): bar\n\nSELECT TRIM(TRAILING 'xyz' FROM 'barxxyz')\\G\n********************* 1. row ************************\nTRIM(TRAILING 'xyz' FROM 'barxxyz'): barx\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/string-functions/trim