BITNOT

Overview

The BITNOT function is used to perform a bitwise NOT operation on an integer type expression. This function can handle any integer type input and returns a result of the same type as the input. In addition to using the bitnot() function, the ~ operator can also be used to achieve the same functionality.

Syntax

BITNOT(expr)

It seems like the document chunk you intended to paste is missing. Please provide the content you want translated, and I'll be happy to assist you while following the rules you've specified.

~expr

Parameters

  • expr: An integer type expression that needs to be bitwise negated.

Return Value

  • Returns the bitwise negated result of the same type as the input expr.

Example

  1. Perform bitwise negation on a single integer:
SELECT BITNOT(100); -- Return result: -101
SELECT ~100;       -- Return result: -101
  1. Perform bitwise NOT operation on integers in the query results:
    SELECT BITNOT(column_name) FROM table_name WHERE condition;
    SELECT ~column_name FROM table_name WHERE condition;