Skip to main content
Version: Latest-4.1

bitnot

Returns the bitwise negation of a numeric expression.

Syntax​

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​

mysql> select bitnot(3);
+-----------+
| bitnot(3) |
+-----------+
| -4 |
+-----------+
Rocky the happy otterStarRocks Assistant

AI generated answers are based on docs and other sources. Please test answers in non-production environments.