メインコンテンツへスキップ
メインコンテンツへスキップ

groupBitAnd

groupBitAnd

導入バージョン: v1.1

数値の系列に対してビット単位の AND 演算を適用します。

構文

groupBitAnd(expr)

エイリアス: BIT_AND

引数

  • expr(U)Int* 型の式。(U)Int*

返される値

(U)Int* 型の値を返します。(U)Int*

ビット単位 AND の例

CREATE TABLE t (num UInt32) ENGINE = Memory;
INSERT INTO t VALUES (44), (28), (13), (85);

-- Test data:
-- binary     decimal
-- 00101100 = 44
-- 00011100 = 28
-- 00001101 = 13
-- 01010101 = 85

SELECT groupBitAnd(num) FROM t;
-- Result:
-- binary     decimal
-- 00000100 = 4

┌─groupBitAnd(num)─┐
│                4 │
└──────────────────┘