The Oracle Syntax
Popular relational database management systems such as Oracle, SQL Server, MySQL, PostgreSQL, IBM DB2, MariaDB and SQLite, among others, all support the standard syntax. Oracle provides for an additional syntax that allows it to not only strip the white space at the end of the string but basically any character that you specify. The syntax for the Oracle syntax is as follows:
The function removes the individual occurrences of every character found starting from the end of trimString until it finds no more. Look at these examples.
RTRIM('123xxx', 'x') returns '123'
RTRIM('Stringabcabc', 'xyz') returns 'String'
RTRIM('abcStringabc', 'abc') returns 'abcString'
RTRIM('Stringabcccab', 'abc') returns 'String'
RTRIM('String582', '0123456789') returns 'String'
Notice in the third example, the first 'abc' characters are left intact. This is because it started stripping from the end and when it came to the 'g' it stopped since 'g' is not part of the trimString.