I’m trying to write quite strange query and i’m having problem with if statement, so i have 2 fields deleted_1 and deleted_2 in my table which i wanna update, so this how i think it should be:
Update `messages`
if(`deleted_1` == null) SET `deleted_1` = 1
else
if(`deleted_2` == null) SET `deleted_2 = 1
---and here goes some simple WHERE statements
but this doesn’t work so basicly i wanna check if a field is empty then update it if not check b field and if it’s empty update b field now i’m not sure maybe it’s possible to do it in more simple way, i’m quite lost here 🙂
this is saying: