본문으로 건너뛰기
최종 수정: 에

GROUP_BIT_XOR

설명​

단일 정수 열 또는 표현식의 모든 값에 대해 비트 XOR 연산을 수행합니다.

구문​

GROUP_BIT_XOR(<expr>)

매개변수​

매개변수설명
<expr>지원하는 타입: TinyInt, SmallInt, Integer, BigInt, LargeInt.

반환 값​

와 동일한 타입의 정수 값을 반환합니다. 모든 값이 NULL이면 NULL을 반환합니다. NULL 값은 비트 연산에서 제외됩니다.

예제​

-- setup
create table group_bit(
value int
) distributed by hash(value) buckets 1
properties ("replication_num"="1");

insert into group_bit values
(3),
(1),
(2),
(4),
(NULL);
select group_bit_xor(value) from group_bit;
+----------------------+
| group_bit_xor(value) |
+----------------------+
| 4 |
+----------------------+
select group_bit_xor(value) from group_bit where value is null;
+----------------------+
| group_bit_xor(value) |
+----------------------+
| NULL |
+----------------------+