I need to update a MYSQL Table
Here is a very simple look at Table_A
ID VALUE RESULT
1 4 0
2 2 0
3 7 0
I want to update the RESULT Column based on conditions
So my query statement needs to look something like
UPDATE Tabel_A
SET RESULT = (if some condition) 1
OR (if another condition) 2
OR (if a different condition) 3
Or should I use something like
UPDATE Tabel_A
SET RESULT = (CASE 1) 1
(CASE 2) 2
(CASE 3) 3
I am not sure how to structure the query
Thanks
I’ll prefer to use
CASEhere.or