Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

How do I write a query for a Oracle database when I have several "like" values for the same column (in my example data "name")?

My example data for table "address":

name like "John"
name like "Jon%"
name like "Jonathan"
name like "Frank"

Is there something like IN() with LIKE in Oracle or do I have to write it for each value OR separated?

share|improve this question
1  
Oracle has REGEXP_LIKE (docs.oracle.com/cd/B14117_01/server.101/b10759/…) . –  a1ex07 Apr 15 '13 at 17:28
    
@a1ex07 thank you for the notice, I will keep it in my mind. But I'm looking for a more common solution. –  powtac Apr 15 '13 at 17:32

1 Answer 1

Using OR would be the way to go, yes.

share|improve this answer
7  
Possibly the shortest valid answer the site will ever see. –  Phil Apr 15 '13 at 18:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.