case mysql multiple conditions within when code example
Example 1: how to add multiple condition in mysql query
SELECT suppliers.suppler_name, orders.order_id
FROM suppliers, orders
WHERE suppliers.supplier_id = orders.supplier_id
AND suppliers.state = 'California';
Example 2: mysql case when multiple conditions
select (
case when (value1 = 1) then (value2)
when (value2 = 1) then (value1) end) as newColumnname
from tablename where value1 = 1 or value2 = 1