Takes n bit arrays and returns a bitwise exclusive OR-ing of its arguments using the following logic: for each bit compared, if there are an odd number of arguments with set bits (odd parity), return 1; otherwise, return 0.
BIT_XOR( bit-expression )
bit-expression The expression for which the value is to be determined. This is commonly a column name.
LONG VARBIT
SQL/2003 Vendor extension.
The following example generates four rows containing a CHAR column, then converts the values to VARBIT.
SELECT BIT_XOR( CAST(row_value AS VARBIT) ) FROM dbo.sa_split_list('0001,0111,0100,0011') |
The result 0001 is determined as follows:
A bitwise exclusive OR (XOR) is performed between row 1 (0001) and row 2 (0111), resulting in 0110.
A bitwise XOR is performed between the result from the previous comparison (0110) and row 3 (0100), resulting in 0010.
A bitwise XOR is performed between the result from the previous comparison (0010) and row 4 (0011), resulting in 0001.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |