9 个解决方案
#1
update tb set Anuma=abs(Anum-1)
#2
update tb set Anuma=case when Anuma=0 then 1 when Anuma=1 then 0 else Anuma end
#3
update tb
set anuma = (case anuma when 1 then 0 when 0 then 1 else anuma end)
#4
update tb set anuma=case when Anuma=0 then 1 when Anuma=1 then 0 else Anuma end
#5
+1
#6
update tb set Anuma=(Anum+1)%2
#7
很少人会考虑用abs,这个很经典
#8
UPDATE tb
SET Anuma=CASE(
WHEN Anuma=0 THEN 1
WHEN Anuma=1 THEN 0
)
#9
UPDATE tb
SET Anuma=Anuma^1 --用异或
#1
update tb set Anuma=abs(Anum-1)
#2
update tb set Anuma=case when Anuma=0 then 1 when Anuma=1 then 0 else Anuma end
#3
update tb
set anuma = (case anuma when 1 then 0 when 0 then 1 else anuma end)
#4
update tb set anuma=case when Anuma=0 then 1 when Anuma=1 then 0 else Anuma end
#5
+1
#6
update tb set Anuma=(Anum+1)%2
#7
很少人会考虑用abs,这个很经典
#8
UPDATE tb
SET Anuma=CASE(
WHEN Anuma=0 THEN 1
WHEN Anuma=1 THEN 0
)
#9
UPDATE tb
SET Anuma=Anuma^1 --用异或