string 在 Oracle 中查找字符串的最后一个索引

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/856817/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 00:26:25  来源:igfitidea点击:

Finding last index of a string in Oracle

oraclestring

提问by JDunkerley

I need to find the last index of a string (e.g. -) within another string (e.g. JD-EQ-0001in Oracle's SQL (version 8i). Is there a way to do this with INSTR()or another function?

我需要-在另一个字符串中(例如JD-EQ-0001在 Oracle 的 SQL(版本 8i)中)找到一个字符串(例如)的最后一个索引。有没有办法用INSTR()或其他函数来做到这一点?

回答by jim0thy

Use -1 as the start position:

使用 -1 作为起始位置:

INSTR('JD-EQ-0001', '-', -1)