How to read a row from right PLSQL

In the table column, I have this value:

DV-2011-01-000004 (data type - varchar2)

How can I get part of the string "000004"? In t-sql they have this right () function, but in PL SQL I cant'seem to search for a function similar to the correct () in t-sql.

Thanks for the help.

+5
source share
2 answers
substr('DV-2011-01-000004', length('DV-2011-01-000004')-6 + 1 )
+8
source

you can use:

 SUBSTR('DV-2011-01-000004', INSTR('DV-2011-01-000004', '-', -1) +1)

when used INSTRwith a negative starting position, it will find the last index “-”. it SUBSTRwill be cut from this event to the end (because I did not supply Length)

+2
source

All Articles