メインコンテンツまでスキップ
バージョン: 26.x

GROUP_BIT_AND

説明

単一の整数列または式内のすべての値に対してビット単位のAND演算を実行します。

構文

GROUP_BIT_AND(<expr>)

パラメータ

Parameterデスクリプション
<expr>サポートする型:TinyInt、SmallInt、Integer、BigInt、LargeInt

Return Value

<expr>と同じ型の整数値を返します。すべての値がNULLの場合、NULLを返します。NULL値はビット演算に関与しません。

Example

-- 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_and(value) from group_bit;
+----------------------+
| group_bit_and(value) |
+----------------------+
| 0 |
+----------------------+
select group_bit_and(value) from group_bit where value is null;
+----------------------+
| group_bit_and(value) |
+----------------------+
| NULL |
+----------------------+