Back to Starrocks

bitnot

docs/en/sql-reference/sql-functions/bit-functions/bitnot.md

4.1.0462 B
Original Source

bitnot

Returns the bitwise negation of a numeric expression.

Syntax

Haskell
BITNOT(x);

Parameters

x: This expression must evaluate to any of the following data types: TINYINT, SMALLINT, INT, BIGINT, LARGEINT.

Return value

The return value has the same type as x. If any value is NULL, the result is NULL.

Examples

Plain
mysql> select bitnot(3);
+-----------+
| bitnot(3) |
+-----------+
|        -4 |
+-----------+