LTRIM(RTRIM(' SQL '))
mysql> mysql> select LTRIM(RTRIM(' SQL ')); +-----------------------+ | LTRIM(RTRIM(' SQL ')) | +-----------------------+ | SQL | +-----------------------+ 1 row in set (0.00 sec)