if in where condition mysql code example
Example 1: mysql if statement in where clause
SELECT `id` , `naam`
FROM `klanten`
WHERE IF(`email` != '', `email`, `email2`) LIKE '%@domain.nl%'
Example 2: in condition in mysql
//Syntax
SELECT * FROM `tableName` WHERE `ColumnName` IN (Value1,Value1,Value1);
//Example:
SELECT * FROM `members` WHERE `membership_number` IN (1,2,3);