跳到主要内容
版本:Latest-3.2

bitmap_andnot

功能

计算两个输入的 bitmap 的差集。差集是指包含所有存在于第一个集合且不存在于第二个集合的元素的集合。

语法

bitmap_andnot(lhs, rhs)

参数说明

lhs: 支持的数据类型为 BITMAP。

rhs: 支持的数据类型为 BITMAP。

返回值说明

返回值的数据类型为 BITMAP。

示例

select bitmap_to_string(bitmap_andnot(bitmap_from_string('1, 3'), bitmap_from_string('2'))) cnt;
+------+
|cnt |
+------+
|1,3 |
+------+

select bitmap_to_string(bitmap_andnot(bitmap_from_string('1,3,5'), bitmap_from_string('1'))) cnt;
+------+
|cnt |
+------+
|3,5 |
+------+