Oracle bitand () functions are common in Oracle databases. The following describes the usage of Oracle bitand () functions in detail. If you are interested, take a look.
Oracle bitand () functions:
Returns the result of the bitwise and operation of two numeric values.
Syntax
BITAND (nExpression1, nExpression2)
Parameters
NExpression1, nExpression2
Specify two values for the AND operation by bit. If nExpression1 AND nExpression2 are non-integer, they are converted to Integers before the AND operation by bit.
Oracle bitand () function return value type:
Numeric type
Description
BITAND () compares each bit of nExpression1 with the corresponding bit of nExpression2. If the bits of nExpression1 and nExpression2 are both 1, the corresponding result bit is 1; otherwise, the corresponding result bit is 0.
Bitand () function example
X = 5 & Binary 0101
Y = 6 & Binary 0110
Bitand (x, y) & Return Value 4, binary is 0100