Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Instr function in oracle

syed haiderFeb 16 2021 — edited Feb 16 2021

I'm trying to find multiple numbers (61 and 62) using instr. Please see below;
select instr('262,500,61', '61') sixty_one, instr('262,500,61', '62') sixty_two
from dual;
The problem is that the sixty_two field is returning a value, whereas, it should be returning 0. What approach can I apply to make sixty_two field return 0 because there is the number 62 doesn't exist?
Thanks in advance

This post has been answered by Frank Kulash on Feb 16 2021
Jump to Answer
Comments
Post Details
Added on Feb 16 2021
5 comments
1,152 views