substr(字符串,截取开始位置,截取长度) //返回截取的字

substr('Hello World',0,1) //返回结果为 'H'  *从字符串第一个字符开始截取长度为1的字符串

substr('Hello World',1,1) //返回结果为 'H'  *0和1都是表示截取的开始位置为第一个字符

substr('Hello World',2,4) //返回结果为 'ello'

substr('Hello World',-3,3)//返回结果为 'rld' *负数(-i)表示截取的开始位置为字符串右端向左数第i个字符

测试:

select substr('Hello World',-3,3) value from dual;

返回结果:'rld'.

If position is 0, then it is treated as 1. 
If position is positive, then Oracle counts from the beginning of string to find the first character.
If position is negative, then Oracle counts backward from the end of string.
If substring_length is omitted, then Oracle returns all characters to the end of string. If substring_length is less than 1, then a null is returned.