我需要编写一个这样的查询:
Select [something]
Where
condition in
case
when (if another_condition = A and 3rd Condition = B) then (C,D)
when (if another_condition = N and 3rd Condition = E) then (F,G)
else (J,K)
end
本质上,我想要的是如果满足 A 和 B,条件可以设置为 C 或 D,如果满足 N 或 E,则条件可以设置为 F 或 G,否则条件设置为 J 或 K。但是,当我运行它时,我在关键字“Case”附近不断收到不正确的语法。
请帮忙!谢谢!