Categories: Bitwise
BITWISE_AND
Returns the bitwise AND of two integer expressions. Returns the same type as the input (INT for INT, BIGINT for BIGINT). Returns NULL if any argument is NULL.
Syntax
BITWISE_AND(op1 NUMERIC, op2 NUMERIC) → NUMERIC
- op1: An
INTEGERorBIGINTexpression - op2: An
INTEGERorBIGINTexpression
Examples
BITWISE_AND exampleSELECT BITWISE_AND(7, 4)
-- 4
SELECT BITWISE_AND(1, 2)
-- 0
SELECT BITWISE_AND(7, NULL)
-- null