JDunkerley
JDunkerley

Reputation: 12495

Finding last index of a string in Oracle

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?

Upvotes: 83

Views: 158835

Answers (1)

jim0thy
jim0thy

Reputation: 2155

Use -1 as the start position:

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

Upvotes: 175

Related Questions