SQL Bitwise Masking SQL Bitwise Masking sqlite sqlite

SQL Bitwise Masking


Check whether the result of "privileges" & 3 is actually equal to 3:

SELECT * FROM "accounts" WHERE ("privileges" & 3) == 3;

Otherwise, the query will select records where at least one bit is set.