BITXOR_AGG
functionsupportedCore SQL functionsReturns the bitwise XOR value of all non-NULL numeric records in a group. In each bit position, if an even number of rows have that bit set to 1, then the function returns 0 for that bit, and if an odd number of rows have that bit set to 1, then the function returns 1 for that bit. If all records inside the group are NULL, or if the group is empty, the function returns NULL.
Syntax
supportedpartialnot supportednot scored
Aggregate function
BITXOR_AGG( [ DISTINCT ] <expr1> )
Window function
BITXOR_AGG( [ DISTINCT ] <expr1> ) OVER ( [ PARTITION BY <expr2> ] )
Parameters
| Name | Required | Description |
|---|---|---|
expr1 | required | This expression must evaluate to a numeric value or a value of a data type that can be cast to a numeric value. |
expr2 | required | This expression is used to group the rows in partitions. |
Returns
The data type of the returned value is NUMBER(38, 0).
Usage notes
- Numeric values are aggregated to the nearest INTEGER data type. Decimal and floating-point values are rounded to the nearest integer before aggregation.
- Aggregating a character/text column (data type VARCHAR, CHAR, STRING, etc.) implicitly casts the input values to FLOAT, then rounds the values to the nearest integer. If the cast is not possible, the value is treated as NULL.
- The DISTINCT keyword can be specified for these functions, but it does not have any effect.
- When this function is called as a window function, it does not support: An ORDER BY clause within the OVER clause.
- Explicit window frames.