ClickHouse/docs/en/sql-reference/aggregate-functions/reference/groupbitmap.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
611 B
Markdown
Raw Normal View History

---
2022-08-28 14:53:34 +00:00
slug: /en/sql-reference/aggregate-functions/reference/groupbitmap
sidebar_position: 128
---
2022-06-02 10:55:18 +00:00
# groupBitmap
Bitmap or Aggregate calculations from a unsigned integer column, return cardinality of type UInt64, if add suffix -State, then return [bitmap object](../../../sql-reference/functions/bitmap-functions.md).
``` sql
groupBitmap(expr)
```
**Arguments**
`expr` An expression that results in `UInt*` type.
**Return value**
Value of the `UInt64` type.
**Example**
Test data:
``` text
UserID
1
1
2
3
```
Query:
``` sql
SELECT groupBitmap(UserID) as num FROM t
```
Result:
``` text
num
3
```