I am tring to find the last position of an element in a column in sql (oracle). If I have on a column the value 20-7-1-2-2
I need the position of the last -
which is 9
. Any ideas how I could find it?
Asked
Active
Viewed 102 times
0

dres
- 499
- 6
- 18
-
1A Google search turned up this answer http://stackoverflow.com/a/856832/50552 – Andomar Aug 20 '14 at 07:26
2 Answers
0
select instr('20-7-1-2-2', '-', -1, 1) from dual
-------------------------------------^
-1 means search from end of string
See the Oracle Instr reference.

Lord Peter
- 3,433
- 2
- 33
- 33