create function level(@score real) --定义一个评级函数
returns char(8)
as
begin
declare @level char(8)
set @level=
case
when @score>100 then '输入错误'
when @score<=100 and @score>=90 then '优秀'
when @score<90 and @score>=80 then '良'
when @score<80 and @score>=70 then '中'
when @score<70 and @score>=60 then '及格'
else '不及格'
end
return @level
end
解决方案 »
- 请求点Reporting Services开发相关的资料.
- 想大家求 15位和18位 身份证查询问题
- 我在连接远程服务器的时候,老是提示远程那个机器guest用户连接不上(那个机器guest用户已经开启)
- 各位仁兄:征求一下意见,数据库表名、字段名用中文好还是用英文好。up有分
- [Microsoft][ODBC SQL Server Driver][DBNETLIB]一般般性网络错误。请检查网络文档..急救啊
- 调查:各位大虾用C/C++干什么工作?待遇如何?工作地点?
- SQLserver数据错位!!!
- [对比问题]一样的数据库,为何情况会有这么大的不同!
- SQL SERVER 的数据库镜像
- ora_12638错误,凭证检索失败!!!
- 如何从第二行开始 立即结贴
- 这是个基础但需要水平的问题,高手请进
效果一样
case when 成绩>=90 then '优秀' when 成绩<60 then '不及格' else '及格' end
select dbo.level(成绩) from tb