I have a table with a bitmask column(unsigned int). This field has values 1, 2, 4, 8, 16, etc.
How do I select for NOT a specific value? IE I don't care what the other bits are - only that a specific bit be 0.
What I've tried:
select count(*) from mytable;
This gives me 3387255.
select count(*) from mytable where outageMask & ~8;
This gives me 552061.
So I would assume that:
select count(*) from mytable where outageMask & 8;
would give me 2835194. Not so. Instead I get 87711.
What am I doing wrong?