Documentation

Sql Rtrim

RTRIM() function removes the trailing whitespaces from input string from the selected column.

Syntax

rtrim(expr)

Arguments

expr The argument expr is any expression of type string

Return Type

string

Return Value

rtrim() returns the input string after removing trailing whitespaces

Remarks

None

Examples

Trimming strings in a column

create table segments
    (_id id, segment string);

insert into segments(_id,segment)
    values (1,'    green    ')

select _id, rtrim(segment) as TrimmedStr from segments;
+-----+------------+
| _id | TrimmedStr |
+-----+------------+
|   1 |     green  |
+-----+------------+
Something missing or incorrect?
Help improve this article or join us on Discord!

© 2022 Molecula Corp. (DBA FeatureBase). All rights reserved.