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

user572405May 22 2009 — edited May 23 2009
I have a column 'Group_Cd' with these values in a table

Group_CD
-------------
AB
CD
EF
AB,CD
AB,CD,EF
CD,EF
AB,EF

if I need to search for a particular code that is sent as a parameter, I am able to use instr function and get the records . foe eg.,

select * from table where
instr(group_cd,'AB') >0 -- for AB records

we have a UI where this value is selected. Sometimes they choose AB and CD and EF. In that case Instr is failing if I say instr(group_cd,'AB,CD,EF').

IS there a way to handle this. I can use multiple instr with a OR, but, I think that is not the best way. Any inputs please. Thanks.

Kumar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2009
Added on May 22 2009
10 comments
714 views