Returns the bitwise AND of two integers.
Limits
BITAND is supported only in Realtime Compute for Apache Flink that uses Ververica Runtime (VVR) 3.0.0 or later.
Syntax
INT BITAND(INT number1, INT number2)Both parameters and the return value are of the INT type.
Parameters
| Parameter | Data type | Description |
|---|---|---|
number1 | INT | The first integer. |
number2 | INT | The second integer. |
Example
This example computes the bitwise AND of 2 (binary: 10) and 3 (binary: 11), which produces 2 (binary: 10).
Test data:
| a (INT) | b (INT) |
|---|---|
| 2 | 3 |
Test statement:
SELECT BITAND(a, b) AS intt
FROM T1;Test result:
| intt (INT) |
|---|
| 2 |