Quick Ref.
Compatibility
TRIM(s)
Engine OK Alternative
ingres yes
mysql yes
oracle yes
postgres yes
sqlserver no LTRIM(RTRIM(s))

TRIM

TRIM(s) returns the string with leading and trailing spaces removed.

 TRIM('Hello world  ') -> 'Hello world' 
This function is particularly useful when working with CHAR fields. Typically a CHAR field is paddded with spaces. In contrast a VARCHAR field does not require padding.

Results
See also: