SQL TRIM

The SQL TRIM() function is used to remove the leading or trailing spaces of a string. Different databases have different writtings:

SQL Server LTRIM(), RTRIM()
Oracle LTRIM(), RTRIM()
MySQL TRIM(), LTRIM(), RTRIM()

In SQL Server or Oracle it doesn’t have Trim() function, we can combine LTrim() and RTrim():

RTRIM(LTRIM(str))

Read more