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

> 비트맵 컬럼의 XOR를 계산하고 UInt64 유형의 카디널리티를 반환하며, 접미사 -State와 함께 사용하면 비트맵 객체를 반환합니다

# groupBitmapXor

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

도입된 버전: v20.1.0

비트맵 컬럼의 XOR를 계산하고 카디널리티를 반환합니다.
접미사 combinator [`-State`](/ko/reference/functions/aggregate-functions/combinators#-state)를 추가하면 비트맵 객체를 반환합니다.

**구문**

```sql theme={null}
groupBitmapXor(expr)
groupBitmapXorState(expr)
```

**인수**

* `expr` — `AggregateFunction(groupBitmap, UInt*)` 타입을 반환하는 표현식입니다. [`AggregateFunction(groupBitmap, UInt*)`](/ko/reference/data-types/aggregatefunction)

**반환 값**

`UInt64` 타입의 개수 또는 `-State` 사용 시 비트맵 객체를 반환합니다. [`UInt64`](/ko/reference/data-types/int-uint)

**예시**

**사용 예시**

```sql title=Query theme={null}
CREATE TABLE bitmap_column_expr_test2
(
    tag_id String,
    z AggregateFunction(groupBitmap, UInt32)
)
ENGINE = MergeTree
ORDER BY tag_id;

INSERT INTO bitmap_column_expr_test2 VALUES ('tag1', bitmapBuild(cast([1,2,3,4,5,6,7,8,9,10] AS Array(UInt32))));
INSERT INTO bitmap_column_expr_test2 VALUES ('tag2', bitmapBuild(cast([6,7,8,9,10,11,12,13,14,15] AS Array(UInt32))));
INSERT INTO bitmap_column_expr_test2 VALUES ('tag3', bitmapBuild(cast([2,4,6,8,10,12] AS Array(UInt32))));

SELECT groupBitmapXor(z) FROM bitmap_column_expr_test2 WHERE like(tag_id, 'tag%');
```

```response title=Response theme={null}
┌─groupBitmapXor(z)─┐
│              10   │
└───────────────────┘
```

**-State combinator 사용하기**

```sql title=Query theme={null}
SELECT arraySort(bitmapToArray(groupBitmapXorState(z))) FROM bitmap_column_expr_test2 WHERE like(tag_id, 'tag%');
```

```response title=Response theme={null}
┌─arraySort(bitmapToArray(groupBitmapXorState(z)))─┐
│ [1, 3, 5, 6, 8, 10, 11, 13, 14, 15]              │
└──────────────────────────────────────────────────┘
```
