RTRIM() Function in SQL
SQL RTRIM() function allows us to remove the trailing empty spaces from the string. Trailing white spaces are the redundant white spaces present at the right end of the string. For example, In “GFG “, there are 5 empty white spaces at the right end of the string.
If there are redundant white spaces at the beginning of the string. For example: ” GFG”, there are 5 whitespaces at the beginning of the string”, these are called leading whitespace.
RTRIM function works in: MySQL 4.0, SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse, Oracle, and all other major database systems.
SQL RTRIM() Function
SQL RTRIM function is a string function that removes spaces from the right side of a character or string. RTRIM or Right Trim function is used in data cleaning and manipulation in SQL.
In this example, we will learn the basics of the RTRIM function, and learn how it works with examples of different use cases.
Contact Us