日期:2014-05-17 浏览次数:20485 次
declare @userClass varchar(20) --用户功臣级别
declare @allCount int
set @allCount=@tcount+@rcount
CASE
when @allCount<10 then @userClass='新手上路' when @allCount between 10 and 20 then @userClass='侠客'
when @allCount between 21 and 30 then @userClass='骑士'
when @allCount between 31 and 40 then @userClass='精灵王'
when @allCount between 41 and 50 then @userClass='光明使者'
when @allCount > 50 then @userClass='法老'
END
declare @userClass varchar(20) --用户功臣级别
declare @allCount INT
set @allCount=@tcount+@rcount;
SELECT @userClass = CASE --注意这里
when @allCount<10 then '新手上路'
when @allCount between 10 and 20 then '侠客'
when @allCount between 21 and 30 then '骑士'
when @allCount between 31 and 40 then '精灵王'
when @allCount between 41 and 50 then '光明使者'
when @allCount > 50 then '法老'
END