SQLite Bitwise Operators are used to perform bitwise operations. These
are also called Binary operators. SQLite uses two’s complement representation for signed integers. Considering the representation of signed integers when working with bitwise operators in SQLite is important.
SQLite Bitwise Operators
Bitwise operators work on bits and perform bit-by-bit operations. SQLite Bitwise operators are as follows in a table format:
|Binary AND Operator
|The bitwise AND operator is a binary operator. The result of the binary AND operation is 1 only if both the bits in the corresponding positions are 1; otherwise, the result is 0.
|Binary OR Operator
|The bitwise OR operator is a binary operator. The result of the OR operation is 1 if at least one of the bits in the corresponding positions is 1; otherwise, the result is 0.
|Binary NOT Operator
|The bitwise NOT operator is a unary operator that performs a bitwise NOT operation on each bit of an integer. The bitwise NOT operation flips each bit, changing 0s to 1s and 1s to 0s.
|Binary XOR Operator
|The bitwise XOR operator is a binary operator that performs a bitwise exclusive OR (XOR) operation on each pair of corresponding bits. The result of the XOR operation is 1 if the bits in the corresponding positions are different; otherwise, the result is 0.
|The left operand’s value is moved left by the number of bits specified by the right operand. The right places are padded with 0s.
|The left operand’s value is moved right by the number of bits specified by the right operand. The left places are padded with 0s.
SQLite tutorials on this website:
For more information on SQLite, visit the official website: