Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

RTRIM

Example

Eliminate trailing spaces from a string.

SELECT RTRIM(‘SQL Tutorial     ‘AS RightTrimmedString;

Definition and Usage

The RTRIM() function removes trailing spaces from a string. while the LTRIM() function removes leading spaces.

Syntax

RTRIM(string)

Parameter Values

 

Parameter

Description

string

Required: The string from which trailing spaces should be removed.

 

Technical Details

Works in:

 SQL Server (starting from 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse.