给你看一个例子吧!
update tbForum set UltimoScore=
(case
when AllScore-RemainScore<0 then 0
else AllScore-RemainScore
end),AllScore=
(case
when ActivityDegree>=0 and ActivityDegree<=300 then 250
when ActivityDegree>=301 and ActivityDegree<=800 then 500
when ActivityDegree>=801 and ActivityDegree<=2000 then 1000
when ActivityDegree>=2001 and ActivityDegree<=4000 then 2000
when ActivityDegree>=4001 and ActivityDegree<=8000 then 4500
when ActivityDegree>8000 then 9000
end),UltimoDegree=ActivityDegree,ActivityDegree = 0
写到where条件中就可以了吧。