To check if a bit is set, your request should be:
SELECT * FROM _table_ x WHERE x.options & (1 << 4) != 0
And check if this is installed:
SELECT * FROM _table_ x WHERE x.options & (1 << 4) = 0
Update : here, how to set a separate bit:
UPDATE table SET options = options | (1 << 4)
To clear a single bit:
UPDATE table SET options = options &~ (1 << 4)
You can also install them all at once using a binary string:
UPDATE table SET options = b'00010010'
source share