请教个 关于 case语法的问题
use student1
go
if exists(select * from sysobjects where type='p' and name like '%proctmp%')
drop proc tmp_proctmp
go
create proc tmp_proctmp @编号 nvarchar(10) ,@math nvarchar(10) output
as
set @math='0'
select @math=b.数学 from class1 a,class1score b where a.编号=@编号 and b.编号=@编号
--case when @math<'60' then ..... - 想如果成绩<60 就输出 不及格赋值给@math
--我怎么写case都是错的 求教各位高人~BTW:过年好~
练手2:
declare @t nvarchar(2)
select @t=数学 from class2score where 编号='11'
CASE when @t<'20'
then 'ok'
end
这样写case 也报一样的错误。。。case 怎么用啊 我看跟帮助里 写的一样么 迷糊 求教~~~