I have to select all the records where:
where FIELD2 like '%value21%' or FIELD2 like '%value22%' or FIELD2 like '%value23%' -- repeat up to or FIELD2 like '%value29%'
Here, value21
, ..., value29
are parameters which the user can put in a form before submitting the query. They are (not subsequent) numerical codes, and FIELD2
is a database column holding a string value.
Which is the most compact form to write down my SQL query?
Note: this is related to an earlier question, but this needs LIKE
rather than equals.