ClickHouse/docs/zh/sql-reference/aggregate-functions/reference/groupbitmap.md
2021-03-25 17:09:19 +08:00

47 lines
550 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.

---
toc_priority: 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
```