Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/156.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 复合条件内格从句_Sql_Oracle_Conditional Statements - Fatal编程技术网

Sql 复合条件内格从句

Sql 复合条件内格从句,sql,oracle,conditional-statements,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' 复合条件,如

我怎么写,举个例子

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'
复合条件,如当1[和]其他“then”值时的

应该使用哪种运算符来代替[和]


谢谢

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

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

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

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

谢谢另外我发现了一篇好文章,谢谢!此外,我还发现了一篇好文章