Back to Starrocks

bitmap_andnot

docs/en/sql-reference/sql-functions/bitmap-functions/bitmap_andnot.md

4.1.0547 B
Original Source

bitmap_andnot

Returns bitmap values that exist in lhs but do not exist in rhs, and returns the new bitmap.

Syntax

Haskell
bitmap_andnot(BITMAP lhs, BITMAP rhs)

Examples

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

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

keyword

BITMAP_ANDNOT, BITMAP