首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

急求一解,关于加减的有关问题

2012-01-30 
急求一解,关于加减的问题table:score字段scoreid771662553814score小于80加5分大于等于80减5分[解决办法]s

急求一解,关于加减的问题
table:score
字段   score     id
          77             1
          66             2
          55             3
          81             4
score小于80加5分   大于等于80   减5分

[解决办法]
select score = case when score <80 then score+5 else score-5 end, id from score
[解决办法]
update score set score = case when score < 80 then score + 5 else score - 5 end
[解决办法]
select score =(case when score <80 then score+5 else score-5 end), id from score
order by id

热点排行