Categories: Bitwise
BITWISE_NOT
Returns the bitwise NOT of the input value by inverting all of its bits. Returns the same type as the input (INT for INT, BIGINT for BIGINT). Returns NULL if the argument is NULL.
Syntax
BITWISE_NOT(op1 NUMERIC) → NUMERIC
- op1: An
INTEGERorBIGINTexpression.
Examples
BITWISE_NOT exampleSELECT BITWISE_NOT(0)
-- -1
SELECT BITWISE_NOT(9223372036854775807)
-- -9223372036854775808
SELECT BITWISE_NOT(NULL)
-- null