All pages
Powered by GitBook
1 of 1

Loading...

LTRIM

Remove leading spaces. This function returns the string with any leading whitespace characters removed.

Syntax

LTRIM(str)

Description

Returns the string str with leading space characters removed.

Returns NULL if given a NULL argument. If the result is empty, returns either an empty string, or with , NULL.

The Oracle mode version of the function can be accessed outside of Oracle mode by using LTRIM_ORACLE as the function name.

Examples

Oracle mode version:

See Also

  • - trailing spaces removed

  • - removes all given prefixes or suffixes

This page is licensed: GPLv2, originally from

RTRIM
TRIM
fill_help_tables.sql
SELECT QUOTE(LTRIM('   MariaDB   '));
+-------------------------------+
| QUOTE(LTRIM('   MariaDB   ')) |
+-------------------------------+
| 'MariaDB   '                  |
+-------------------------------+
SELECT LTRIM(''),LTRIM_ORACLE('');
+-----------+------------------+
| LTRIM('') | LTRIM_ORACLE('') |
+-----------+------------------+
|           | NULL             |
+-----------+------------------+
SQL_MODE=Oracle