case case子句中的复合条件

lex*_*eme 1 sql oracle conditional-statements

我怎么写,给定的例子,

select attendee, begindate
case evaluation
    when 1 then 'bad'
    when 2 then 'mediocre'
    when 3 then 'ok'
    when 4 then 'good'
    when 5 then 'excellent'
    else 'not filled in'
end
from registrations
where course = 'S02'
Run Code Online (Sandbox Code Playgroud)

复合条件如when 1[和] 其他 '那么'的价值.

操作员应该使用什么而不是[和]?

谢谢!

Jam*_*man 5

建议你以不同的方式构建你的案例:

case
    when evaluation in (1,2) then 'bad'
    when evaluation = 3 then 'ok'
    when evaluation = 4 then 'good'
    when evaluation = 5 then 'excellent'
    else 'not filled in'
end
Run Code Online (Sandbox Code Playgroud)