BITNOT Function

The BITNOT function can take any number type value that is one less than the maximum INT8 value.

Fractional values are truncated before the bit operation. The result is the bitwise NOT of its argument.

The returned data type is the same type as the argument if the argument is SMALLINT, INT, BIGINT, or INT8. Otherwise the returned data type is DECIMAL(32).

The following query calls the BITNOT function:
SELECT BITNOT(8) AS bitnot FROM systables WHERE tabid = 1;
The following table shows the output of this SELECT statement.
bitnot
   -9
The next query calls the BITNOT function with a negative argument:
SELECT BITNOT(-20) AS bitnot FROM systables WHERE tabid = 1;
The following table shows the output of this SELECT statement.
bitnot
   19