Oracle中獲取字元串下標、截取字元串 獲取下標: SELECT INSTR('AAA-BBB-CCC-DDD', '-', 1, 1) as 字元位置 FROM dual 截取字元串: SELECT SUBSTR('AAA-BBB-CCC-DDD', 1, 3) as 截取字元串 FROM DU ...
Oracle中獲取字元串下標、截取字元串
獲取下標:
SELECT INSTR('AAA-BBB-CCC-DDD', '-', 1, 1) as 字元位置 FROM dual
截取字元串:
SELECT SUBSTR('AAA-BBB-CCC-DDD', 1, 3) as 截取字元串 FROM DUAL
解釋: