ClickHouse/docs/zh/sql-reference/aggregate-functions/reference/groupbitmap.md
2022-08-26 15:07:59 -04:00

48 lines
620 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
slug: /zh/sql-reference/aggregate-functions/reference/groupbitmap
sidebar_position: 128
---
# groupBitmap {#groupbitmap}
从无符号整数列进行位图或聚合计算,返回 `UInt64` 类型的基数,如果添加后缀 `State` ,则返回[位图对象](../../../sql-reference/functions/bitmap-functions.md)。
**语法**
``` sql
groupBitmap(expr)
```
**参数**
`expr` 结果为 `UInt*` 类型的表达式。
**返回值**
`UInt64` 类型的值。
**示例**
测试数据:
``` text
UserID
1
1
2
3
```
查询:
``` sql
SELECT groupBitmap(UserID) as num FROM t
```
结果:
``` text
num
3
```