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!

Using "LIKE" with a subquery?

459560Aug 30 2007 — edited Aug 31 2007
I am running a query that returns a few text values (right now, there are three, but more could be added). What I need to do is then run a LIKE operator on a text field to see if that field contains any of these three values.

select values from table1;

select * from table2 where field1 like (%values%)

yes, I know that I cannot use like with multiple values (without an OR), and I know that I cannot use like with a subquery. What I am looking for is a way in SQL or PL/SQL to do this. I'm guessing I would have to use some sort of a loop and counter. It seems like it's going to be pretty ugly. Any suggestions would be greatly appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2007
Added on Aug 30 2007
4 comments
2,039 views