PostgreSQL RTRIM() function
RTRIM() function
The PostgreSQL rtrim function is used to remove spaces( if no character(s) is provided as trimming_text ) or set of characters which are matching with the trimming_text, from the end of a string.
Syntax:
rtrim(<string> [, < trimming_text >])
PostgreSQL Version: 9.3
Pictorial Presentation of PostgreSQL RTRIM() function

Example: PostgreSQL RTRIM() function:
In the example below, the matching text is 'best' mention in the second parameter in which 'e','s' and 't' is matching from the end of the first parameter and removed from the string.
Code:
SELECT rtrim('rtrimtest', 'best');
Sample Output:
rtrim ------- rtrim (1 row)
Example 2:
In the example below, no matching text is specified so the default white spaces have been removed from the end of the string.
Code:
SELECT rtrim('rtrim ');
Sample Output:
rtrim ------- rtrim (1 row)
Previous: RPAD function
Next: SPLIT_PART function
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook