LTRIM Function in MS SQL Server and MySQL


LTRIM stands for left trim — it trims blank spaces occurring on the left side of a given string.

MSSQL

Syntax:

LTRIM(string)

Example:

select ltrim('    smith');
------------------------
smith

select ltrim('Hello');
-------------------
Hello

LTRIM function in MSSQL

MySQL

In MySQL, LTRIM does the same job — trims any blank spaces from the left side of a given string.

Syntax:

LTRIM(string)

Example:

mysql> select ltrim(' smith');
+-------------------+
| ltrim(' smith')   |
+-------------------+
| smith             |
+-------------------+

mysql> select ltrim('Hello');
+----------------+
| ltrim('Hello') |
+----------------+
| Hello          |
+----------------+

LTRIM function in MySQL

Back to Converting Functions from MSSQL to MySQL