Using the LTRIM() and RTRIM() Oracle Functions

Using RTRIM() to remove trailing spaces

SELECT FIRSTNAME || ' ' || RTRIM(LASTNAME) AS "With RTRIM" FROM STUDENTS WHERE RowNum < 11

Using LTRIM() to remove leading spaces

SELECT  
   LTRIM(FIRSTNAME) AS "LTRIM"        
FROM    STUDENTS
WHERE RowNum < 11 

 Collapse All    Expand All
Custom Search

Oracle Information and Resources