substr(string, position)
substr(string, position, length)
Examples:
select substr('1234567890',4) from dual;
4567890
However, if the position parameter is 0, it is treated like being 1:
select substr('1234567890',0, 3) from dual;
123
select substr('1234567890',1, 3) from dual;
123
The parameter can also be negative, in which case it is counted from the right side:
select substr('1234567890',-4,3) from dual;
789
substr(string, position, length)
Examples:
select substr('1234567890',4) from dual;
4567890
However, if the position parameter is 0, it is treated like being 1:
select substr('1234567890',0, 3) from dual;
123
select substr('1234567890',1, 3) from dual;
123
The parameter can also be negative, in which case it is counted from the right side:
select substr('1234567890',-4,3) from dual;
789
Comments
Post a Comment