instr(原始字串, 目標字串, 起始位置, 匹配序號)
select instr('0.5mg/cc','mg',1,1) as iLen from dual; => would return 4
原始字串 '0.5mg/cc'; 目標字串 'mg'; 起始位置 1; 取第1個匹配項的位置
預設查找順序為從左到右。當起始位置為負數時,從右邊開始查找。
Examples:
instr('Tech on the net', 'e') would return 2; the first occurrence of 'e'
instr('Tech on the net', 'e', 1, 1) would return 2; the first occurrence of 'e'
instr('Tech on the net', 'e', 1, 2) would return 11; the second occurrence of 'e'
instr('Tech on the net', 'e', 1, 3) would return 14; the third occurrence of 'e'
instr('Tech on the net', 'e', -3, 2) would return 2.
via: TECH on the Net
沒有留言:
張貼留言