The LTRIM Function in Oracle SQL / PLSQL is used to remove the specified characters in a string from the left side.
Syntax for the using the LTRIM Function in Oracle SQL / PLSQL is:
SELECT LTRIM(string_1,[string_2])
FROM table_name;
- string_1 is the string which will be trimmed from the left side
- string_2 is the string which will be matched in string_1 for trimming, it’s an optional parameter, if omitted then LTRIM function will remove all the spaces in string_1from left side.
Examples:
Using LTRIM Function in Oracle SQL / PLSQL SELECT statement:
SELECT LTRIM('Tech Honey', 'T') FROM dual;
Will return ‘ech Honey’
SELECT LTRIM('Tech Honey', 'Tech') FROM dual;
Will return ‘Honey’
SELECT LTRIM(' Tech Honey') FROM dual;
Will return ‘Tech Honey’
SELECT LTRIM('56789Tech Honey', '0123456789') FROM dual;
Will return ‘Tech Honey’
SELECT LTRIM('111111Tech Honey', '1') FROM dual;
Will return ‘Tech Honey’