MySQL Forums
Forum List  »  Newbie

Re: DELTE with multiple conditions same column does not execute
Posted by: Shawn Green
Date: July 14, 2022 12:40PM

Compare your logic to this... (I'm using Phillip's rewrite)

DELETE... WHERE val NOT IN (1,3,5,7,9)

This is the same type of command that you are executing. I can have row where val=2 and I would expect this command to remove that row.

The rewrite works because this logical statement

WHERE (NOT A) and (NOT B) and (NOT C)

is the same as

WHERE NOT (A or B or C)

In this case I am using the placeholders "A", "B". and "C" to represent your tests such as " groepnaam <> 'SUBSIDIARY' " which can be rewritten as " NOT (groepnaam = 'SUBSIDIARY') "

Does this help?

Options: ReplyQuote


Subject
Written By
Posted
Re: DELTE with multiple conditions same column does not execute
July 14, 2022 12:40PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.