如何在sql中使用if语句检查多个条件
在伪代码中
If survey_field is 1 and emp_code_field = 1 and post_field = 1 THEN set chance to 10
else if survey_field is 1 and emp_code_field = 1 THEN set chance to 5
survey_field is 1 THEN set chance to 1
我尝试了以下但我无法使用多个条件。
Update employee
SET chance =
CASE survey
WHEN 1 THEN 1
END
WHERE 1