……………………………………………………………………………………………………………………………………
> case 多分支语句
case
when 条件1 then 结果1
when 条件2 then 结果2
………
else
end
select * form stumarks
select stuno,成绩 = case
when writtenexam<60 then ''e''
when writtenexam between 60 and 69 then ''d''
when writtenexam between 70 and 79 then ''c''
when writtenexam between 80 and 89 then ''b''
else ''a''
end
from stumarks
author: k&j
QQ:403455281
16:51 2007-4-13