2017-10-06 1:28 GMT-06:00 Clemens Ladisch <clem...@ladisch.de>:
> Alex Henrie wrote:
>> I wanted to use the XOR operator in a query today, but then found out
>> that SQLite doesn't support it.
> For boolean values, "a XOR b" = "a <> b".
> For binary values, "a XOR b" = "(a | b) - (a & b)".
Thank you, I had forgotten that exclusive-or is equivalent to
not-equals for boolean values. Still, it would be a little nicer if I
could write a == b XOR c == d instead of (a == b) != (c == d). It
would be even more readable for non-boolean values: a XOR b instead of
(NOT NOT a) != (NOT NOT b).
Anyway, thanks for the help. I'd love to see boolean XOR in SQLite,
but if not, at least I have a solution now.
sqlite-users mailing list