LTRIM to remove space Prefix to a string

LTRIM() removes leading spaces. Use RTRIM() for trailing spaces or TRIM() for both ends.

MySQL Ltrim
SELECT LTRIM('  plus2net.com') -- Output plus2net.com

LTRIM with UPDATE

To remove blank space before the name in our student table
UPDATE student SET name=LTRIM(name)

Read more on UPDATE Query

We can add space to a column and also display the same after removing space.
SELECT CONCAT('    ',name), LTRIM(CONCAT('   ',name))  FROM student
Read more on CONCAT






Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer