Updated on 2026-11-06 GMT+08:00

BITAND

Syntax

INT BITAND(INT number1,INT number2)

Description

Performs a bitwise AND operation. The bitwise AND operation compares the binary bits of two integers bit by bit. If both corresponding bits are 1, the result bit is 1. Otherwise, the result bit is 0.

Input Parameters

Parameter

Data Type

number1

INT

number2

INT

The input and output parameters must be of the same integer type.

Example

CREATE TABLE source (
  f_sequence INT
) WITH (
  'connector' = 'datagen',
  'rows-per-second' = '1'
);
CREATE TABLE print with(
'connector' = 'print'
) as select
  BITAND (2, 3) as int1
from source;

The returned result is 2, and the data type is INT.