LTRIM Function In SQL Server 2008

In this article i will explain how to use LTRIM Function in SQL.
  • 2963

Introduction

LTRIM() Function returns a character expression after it removes leading blanks.

Syntax

SELECT LTRIM (character_expression)

where character_expression could be a constant variable or column.

Example

1. LTRIM() function used to remove leading spaces from given string.

LTRIM-Function-SQL.jpg

2. Suppose we have table named Employee as.

CreateTable-in-sqlserver.jpg

To return the the "F_Name " column after removing leading blanks.

SQL-LTRIM-function.jpg

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.