The bit_complement() function
The bit_complement() function performs a logical NOT, or one's complement on a single binary data type column.
Syntax
bit_complement(column)
- column
- The input binary data type column.
Usage
The function changes each binary digit to its complement. Each0
becomes a 1
and
each 1
becomes a 0
.Return codes
The function returns the value of the bitwise logical NOT operation.Example
In the following example the value ofbinaryvarcol1
is '00086000':SELECT bit_complement(binaryvar_col1) FROM table WHERE x = 1
expression
------------------
FFF79FFF