IN and LIKE command combination, Possible?

  • Thread starter Thread starter Lim Heng Sin
  • Start date Start date
L

Lim Heng Sin

In the WHERE clause....

..... where area = "india" or area "china"

can be equivalent to:

where area IN("india","china").

What if:
where area like "a*" or area like "b*"

How to put the Like and IN command together

I'm trying to optimize the query because there are many
records
 
Hi,



Put the alternatives in a table, alts, one field, alt:

alts ' table name
alt ' field name
a*
b*
' data sample ( 2 rows)



WHERE table1.field1 LIKE alts.alt



(you can use a join rather than a WHERE clause, if you prefer, since you
technically involve two different tables, that is a join).



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top