Finding last index of a string in Oracle

OracleString

Oracle Problem Overview


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

Oracle Solutions


Solution 1 - Oracle

Use -1 as the start position:

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJDunkerleyView Question on Stackoverflow
Solution 1 - Oraclejim0thyView Answer on Stackoverflow