We can trim a character in teradata as shown below:-
If you want to trim particuler character from both the end (Leading and Trailing) then you need to use 'BOTH' keyword:-
SELECT TRIM (BOTH '1' FROM '12341');
Output is:- 234
You can trim leading character from a string:-
SELECT TRIM (LEADING '1' FROM '11234');
Output is:- 234
You can trim trailing character from a string:-
SELECT TRIM (TRAILING '4' FROM '12344');
Output is:- 123
If you want to trim particuler character from both the end (Leading and Trailing) then you need to use 'BOTH' keyword:-
SELECT TRIM (BOTH '1' FROM '12341');
Output is:- 234
You can trim leading character from a string:-
SELECT TRIM (LEADING '1' FROM '11234');
Output is:- 234
You can trim trailing character from a string:-
SELECT TRIM (TRAILING '4' FROM '12344');
Output is:- 123
No comments:
Post a Comment