Search code examples
sqloracle-databaseplsqlsql-in

using % is IN condition


Usually when one has to search in oracle for a single where condition where you don't know the exact condition we use :

Select * from Table where column like '%Val%'

If I have to run check for multiple condition we use IN

Select * from Table where column in ('Value1','ABC2')

How we combine the two ?i.e , search for a bunch of values in DB when the exact value is not know The below code doesn't give the desired result as it considers the whole as a string .

Select * from Table where column in ('%Val%','%AB%')

Solution

  • Select * from Table where column like  '%Val%' or column like '%AB%';