80

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?

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
JDunkerley
  • 12,355
  • 5
  • 41
  • 45

1 Answers1

169

Use -1 as the start position:

INSTR('JD-EQ-0001', '-', -1)
Community
  • 1
  • 1
jim0thy
  • 2,095
  • 1
  • 18
  • 27