Syntax
Scalar
Arguments
Returns
- Type: Same signed integer type as value
- Possible values: The bitwise complement of value in its input width.
- NULL behavior: Returns NULL when an argument is NULL.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Inverts every bit of a signed integer.
bitwise_not(value)
| Name | Type | Required | Description |
|---|---|---|---|
| value | TINYINT, SMALLINT, INT or BIGINT | Yes | The integer to complement. |
| Property | Value |
|---|---|
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |
SELECT bitwise_not(0) AS complement, bitwise_not(CAST(NULL AS INT)) AS null_value;
| complement | null_value |
|---|---|
| -1 | NULL |
SELECT bitwise_not(CAST(0 AS BIGINT)) AS inverted;
| inverted |
|---|
| -1 |