Data Loader

 

LTRIM function in MS SQL Server and MySQL

LTRIM stands for left trim, and 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 the LTRIM function also does the same job. i.e. it trims any blank spaces from the left side of a given string.

Syntax

LTRIM(string)

Example

mysql> select ltrim(' smith');
+-------------------+
| ltrim(' smith') |
+-------------------+
| smith |
+-------------------+
1 row in set (0.00 sec)

mysql> select ltrim('Hello');
+----------------+
| ltrim('Hello') |
+----------------+
| Hello |
+----------------+
1 row in set (0.00 sec)
LTRIM function in MySQL
 

Back to Converting Functions from MSSQL to MySQL