I'm writing sql UPDATE to 2 columns with 2 conditions. Before I run sql the sender_del_flag and receiver_del_flag are all 0 but after I run this some value return null. I wonder why it changed to null. How to fix this?
UPDATE `messages` SET
receiver_del_flag = CASE
WHEN `id`='4' AND receiver='92' THEN '1'
WHEN `id`='6' AND receiver='92' THEN '1'
WHEN `id`='8' AND receiver='92' THEN '1'
END,
sender_del_flag = CASE
WHEN `id`='4' AND sender='92' THEN '1'
WHEN `id`='6' AND sender='92' THEN '1'
WHEN `id`='8' AND sender='92' THEN '1'
END
WHERE id IN ('4', '6', '8')
