The SQL Trim feature is are functions (LTRIM and RTRIM) that remove leading and trailing blanks from a string.
For example, the function LTRIM(' Minnesota') returns:
'Minnesota'
The SQL Trim functions (LTRIM and RTRIM) are useful in cleansing data that contains leading and trailing blanks.
SQL TRIM is used as follows.
SQL TRIM Syntax
SQL TRIM Example
The LTRIM function removes the leading blanks in the string ' Bob'.
This SQL Statement with LTRIM is executed:
Here is the result.
trimmed_string |
Bob |
Advertisements:
Infogoal.com is organized to help you gain mastery.
Examples may be simplified to facilitate learning.
Content is reviewed for errors but is not warranted to be 100% correct.
In order to use this site, you must read and agree to the
terms of use, privacy policy and cookie policy.
Copyright 2006-2020 by Infogoal, LLC. All Rights Reserved.