UPDATE Table
SET X = 0,Y = 0
From Table
Where X > 9.99 or Y > 9.99
I need to set X's value to zero if it exceeds 9.99 and set Y's value to zero if it exceeds 9.99.
How can i achieve it in SQL.
Mine seems incorrect.
Please Help.
答案 0 :(得分:1)
UPDATE your_Table
SET X = case when X > 9.99
then 0
else X
end,
Y = case when Y > 9.99
then 0
else Y
end
WHERE X > 9.99 or Y > 9.99