Takes n bit arrays and returns a bitwise OR-ing of its arguments using the following logic: for each bit compared, if any bit is 1, return 1; otherwise, return 0.
BIT_OR( bit-expression )
expression The expression for which the value is to be determined. This is commonly a column name.
SQL/2003 Vendor extension.
Suppose you have the following table, t, containing a single column, a, which is a VARBIT data type.
You want to know the OR value for the column. You enter the following SELECT statement, which returns 0111:
SELECT BIT_OR( a ) FROM t;
This result is determined as follows:
Row 1 (0001) is compared with Row 2 (0111), and results in 0111.
The result from the previous comparison (0111) is compared with Row 3 (0100), and results in 0111.
The result from the previous comparison (0111) is compared with Row 4 (0011), and results in 0111.