Oracle中获取字符串下标、截取字符串
获取下标:
SELECT INSTR('AAA-BBB-CCC-DDD', '-', 1, 1) as 字符位置 FROM dual
截取字符串:
SELECT SUBSTR('AAA-BBB-CCC-DDD', 1, 3) as 截取字符串 FROM DUAL
解释:
获取下标:
SELECT INSTR('AAA-BBB-CCC-DDD', '-', 1, 1) as 字符位置 FROM dual
截取字符串:
SELECT SUBSTR('AAA-BBB-CCC-DDD', 1, 3) as 截取字符串 FROM DUAL
解释: