mysql case when multiple conditions
SELECT CASE col1
WHEN 'agree' THEN 'Ok'
WHEN 'disagree' THEN 'Ko'
ELSE
CASE
WHEN col2 >= 1 THEN 'Ko'
ELSE 'Maybe'
END
END AS my_result
FROM table_name;
mysql case when multiple conditions
SELECT CASE col1
WHEN 'agree' THEN 'Ok'
WHEN 'disagree' THEN 'Ko'
ELSE
CASE
WHEN col2 >= 1 THEN 'Ko'
ELSE 'Maybe'
END
END AS my_result
FROM table_name;
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us