Is there a better way to write the following 'where' portion of a mysql query:
WHERE t.status IS NOT 'resolved'
AND t.status IS NOT 'closed'
AND t.status IS NOT 'deleted'
can they be combined into a single where statement?
WHERE t.status NOT IN ('resolved', 'closed', 'deleted')
Boolean algebra says these two expressions are equivalent:
NOT A AND NOT B AND NOT C
NOT (A OR B OR C)
This is DeMorgan's Law.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With