-
Instr?
I want to find the position of the last occurence of a string.
ex:
'1,2,3,4,5,6,1,2,3'
The position of the last occurence of the character '1' is 13.
if i do
SQL> select instr('1,2,3,4,5,6,1,2,3','1') from dual;
INSTR('1,2,3,4,5,6,1,2,3','1')
------------------------------
1
it gives me only the first occurence of the string
I need a function that does this, anyone?
-
Code:
SQL> select * from xyz;
X Y Z
---------- -------------------- ----
1 1,5,2,3,5,7,1,2,4,5 777
SQL> select y, instr(y,'2',-1) from xyz;
Y INSTR(Y,'2',-1)
-------------------- ---------------
1,5,2,3,5,7,1,2,4,5 15
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|