UPDATE `Table1` SET `col3` =
CASE `col1`
WHEN 'ABC' THEN '2'
WHEN 'BCD' THEN '3'
ELSE '0'
END
In this, can I have condition for both col1 and col2 to set the value for col3 like if I have
col1 = 'ABC' AND col2 = '123'
then I want to set
col3 = 2 and col1 = 'ABC' AND col2 = '124' then set col3 = '4'
and how to set multiple column values at a time? Suppose here if I have col4 also then how to set both col3 and col4 values depending on the col1 and col2 values?
Updating multiple columns, and multiple conditions in when clause.