Using the LTRIM() and RTRIM() MySQL Functions

Using RTRIM() to remove trailing spaces

SELECT  
   CONCAT(RTRIM(firstname),' ',lastname) AS "With RTRIM"
FROM    Students
LIMIT 10

Using LTRIM() to remove leading spaces

SELECT  
   LTRIM(disenrollment_type)         
FROM    disenrollmentTypes  
LIMIT 10

 Collapse All    Expand All
Custom Search

MySQL Information and Resources