How can i introduce multiple conditions in LIKE operator for MS Access SQL

Kajiyama picture Kajiyama · Apr 23, 2015 · Viewed 15.6k times · Source

I would like to know, if there is any way, how to achieve something like this in access sql.

select * from my_table where column_name like ('ABC%', 'MOP%');

I tried use this: https://stackoverflow.com/a/1387797/1784053 but this seems not to work in Access.

Is there way on how to achieve anything like multiple like conditioning based on dynamic set of conditions? This means, that I cant use OR neither UNION because my set of conditions is dynamic.

Similar question: How can i introduce multiple conditions in LIKE operator

Answer

Jarvis Stark picture Jarvis Stark · Apr 23, 2015

You can try this:

select * 
from my_table 
where column_name like ('ABC%') or column_name like ('MOP%');