If you type
SELECT (true or true and false)
in mysql it will return 1
which is true
. Why is that so? What's the order of evaluation in boolean expressions?
According to the MySQL documentation on operator precedence, AND is evaluated before OR.
That means your expression (true OR true AND false)
is evaluated as (true OR (true AND false))
.
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