BITAND
Descriptionβ
Used to perform a bitwise AND operation. The bitwise AND operation compares each bit of two integers. The result is 1 only when both corresponding binary bits are 1, otherwise it is 0.
Integer range: TINYINT, SMALLINT, INT, BIGINT, LARGEINT
Syntaxβ
BITAND( <lhs>, <rhs>)
Parametersβ
parameter | description |
---|---|
<lhs> | The first number involved in the bitwise AND operation |
<rhs> | The second number to be included in the bitwise AND operation |
Return Valueβ
Returns the result of the AND operation on two integers.
Examplesβ
select BITAND(3,5), BITAND(4,7);
+---------+---------+
| (3 & 5) | (4 & 7) |
+---------+---------+
| 1 | 4 |
+---------+---------+