-1

I was trying a query like this one, select * from table where column like in ('abc%','bcd%', '%cde') but not working. Basically I cannot use like operator with Or as I don't know how many values i will get at runtime. This values are coming from a subquery.

Requirements are to match with multiple values with pattern. But number of multiple values not known.

1 Answers1

0

I recommend to use “union all”, seperate select query for each like statement, as below:

select * from table where column like 'abc%'
Union All
select * from table where column like 'bcd%'
Union All
select * from table where column like '%cde'
jepozdemir
  • 260
  • 1
  • 4