Oracle SQL - Using TRIM function

Introduction

TRIM function removes a set of characters from both sides of a string.

The general format for this function is:

TRIM ([{leading_characters | trailing_characters | both} 
[trim_character]) | 
     trim_character} FROM | source_string) 

Demo

SQL>
SQL> SELECT TRIM(trailing 's' from 'Cars') FROM dual ;

TRI-- from ww w. j  av a 2s  .  co m
---
Car

SQL>

Related Topic