Skip to main content

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 INTEGER or BIGINT expression
  • op2: An INTEGER or BIGINT expression

Examples

BITWISE_AND example
SELECT BITWISE_AND(7, 4)
-- 4
BITWISE_AND example
SELECT BITWISE_AND(1, 2)
-- 0
BITWISE_AND with a NULL argument
SELECT BITWISE_AND(7, NULL)
-- null