sql 列 计算[解决办法]2005以后:with test as (select id,scores,case when scores60 then 0 else (sco
sql 列 计算 [解决办法] 2005以后:
;with test as ( select id,scores,case when scores<=60 then 0 else (score-60)/10 end grade from score ) update score set score.grade=test.grade from score inner join test on score.id=test.id and score.scores=test.scroes
下次麻烦把你想法写清楚,不要让别人去猜,比如你只是想查询?还是想更新。ok? [解决办法]
楼主应该是想根据ID、SCORES字段来更新grade字段。
发哥正解! [解决办法] update SCORE set grade=(case when scores<=60 then 0 else (score-60)/10 end) [解决办法] 你是想在插入的时候更新,还是你的数据已经有了,现在要更新。总的说清楚吧