Is there an easier way to this update?
UPDATE mailbox SET toNew = 1, toDelete = 0 WHERE msgID = 1 AND msgFrom = 1
UPDATE mailbox SET fromNew = 1, fromDelete = 0 WHERE msgID = 1 AND msgTo = 1
I tried using an IF but it didn’t work…
UPDATE mailbox SET IF(msgTo = 1, toNew, fromNew) = 1, toDelete = 0 WHERE msgID = 1
Any ideas?
This could do the trick, though I prefer your original queries as they are more readable IMO