MYSQL - Select statement to select multiple rows that contains multiple values


Usually if we have multiple value to look up in table we might use

SELECT * FROM <tablename> 
WHERE <field> LIKE '%parameter1%' OR <field> LIKE '%parameter2%' OR <field> LIKE '%parameter3%';

If we have a lot of parameters, we might find it difficult to write the statement.

Therefore instead of using OR, we can also use REGEXP as below

SELECT * FROM <TABLENAME>
WHERE <field> REGEXP 'parameter1|parameter2|parameter3|parameter4|parameter5';