Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Ltrim Function In Sql in SQL

Ltrim Function In Sql in SQL

? LTRIM Function in SQL

The LTRIM function removes leading spaces (spaces on the left side) from a string.


? Syntax:

LTRIM(string)
  • string: The text you want to trim leading spaces from.


? Example:

SELECT LTRIM('   Hello World') AS trimmed;

Result:

trimmed
Hello World

? Notes:

  • It does not remove trailing spaces (use RTRIM for that).

  • To remove both leading and trailing spaces, use:

    • TRIM() (in most modern databases)

  • Supported in:

    • ? MySQL

    • ? SQL Server

    • ? PostgreSQL

    • ? Oracle


? Combined Example:

SELECT  LTRIM('   Text') AS left_trim,  RTRIM('Text   ') AS right_trim,  TRIM('   Text   ') AS full_trim;

Let me know if you want string cleanup examples in a real table!

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql