> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-86180b7b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 一連の数値に対してビット単位の `AND` を適用します。

# groupBitAnd

<div id="groupBitAnd">
  ## groupBitAnd
</div>

導入バージョン: v1.1.0

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

**構文**

```sql theme={null}
groupBitAnd(expr)
```

**別名**: `BIT_AND`

**引数**

* `expr` — `(U)Int*` 型の式。[`(U)Int*`](/ja/reference/data-types/int-uint)

**戻り値**

`(U)Int*` 型の値を返します。[`(U)Int*`](/ja/reference/data-types/int-uint)

**例**

**ビット単位の AND の例**

```sql title=Query theme={null}
CREATE TABLE t (num UInt32) ENGINE = Memory;
INSERT INTO t VALUES (44), (28), (13), (85);

-- テストデータ:
-- 2進数      10進数
-- 00101100 = 44
-- 00011100 = 28
-- 00001101 = 13
-- 01010101 = 85

SELECT groupBitAnd(num) FROM t;
```

```response title=Response theme={null}
-- 結果:
-- binary     decimal
-- 00000100 = 4

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