新英朗变速箱脱档:问一个有关SQL语言的问题

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 08:38:45
DECLARE @fltscope FLOAT,@strresult CHAR(2)
SELECT @fltscope=65
set @strresult=
case
when @fltscope<70 and @fltscope>=60 then '可'
when @fltscope<80 and @fltscope>=70 then '中'
when @fltscope<90 and @fltscope>=80 then '良'
when @fltscope<=100 and @fltscope>=90 then '优'
else '差'
end
print '学生评级结果:'+@strresult
go
请问不要第二句行吗?即:SELECT @fltscope=65 在when语句中不是相当于给它赋值了吗?
那是不是赋值一定要65~赋其它值不行吗

第2行是赋值 when语句中是判断

这里的第二行跟set @fitscope=65是等同的。不可没有。