1:update 表名 set 列名= SUBSTR(列名,INSTR(列名,\'匹配字符\',1,1)+1) where 条件 like \'%*%\'
2:select SUBSTR(列名,INSTR(列名,\'、\',1,1)+1) as d from 表名 t where 条件 like \'%-%\';
例:Select INSTR(‘ORC+001‘,‘+‘,1,1) from dual
返回的是"4" 如果该字符串没有匹配字符 返回的是“0”。
INSTR:INSTR方法的格式为
INSTR(源字符串, 目标字符串, 起始位置, 匹配序号)
上2:中+1 是因为截取到的位置是从匹配字符开始,所以得从下一位开始截取,无长度截取,若不+1则会保留、截取
取得字符串中指定起始位置和长度的字符串 substr( string, start_position, [ length ] ) 如:
substr(\'This is a test\', 6, 2) would return \'is\'
substr(\'This is a test\', 6) would return \'is a test\'
substr(\'TechOnTheNet\', -3, 3) would return \'Net\'
substr(\'TechOnTheNet\', -6, 3) would return \'The\'
select substr(\'Thisisatest\', -4, 2) value from dual 结果是 te
select substr(\'emros\',-3,1) value from dual 结果是 r