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.
The following table lists the results of the AND operation on nExpression1 AND nExpression2 by bit:
NExpression1 nExpression2 result bit
0 0 0
0 1 0
1 1 1
1 0 0
Bitand () function example
X = 5 & Binary 0101
Y = 6 & Binary 0110
? Bitand (x, y) & Return Value 4, binary is 0100
-----------------------------------------------------------------------------
The preceding section describes the syntax of the Oracle bitand () function.
Use of oracle Aggregate functions
Oracle functions for Calculating Time Difference
Use of oracle custom functions
Oracle TRIM function syntax
Oracle date functions