Skip to main content

BITMAP_AND_NOT_COUNT,BITMAP_ANDNOT_COUNT

Description​

Performs a NOT operation on two BITMAPs and returns the number of elements in the result set. The first input parameter is called base BITMAP and the second is called exclusion BITMAP.

Alias​

  • BITMAP_ANDNOT_COUNT

Syntax​

BITMAP_AND_NOT_COUNT(<bitmap1>, <bitmap2>)

Parameters​

ParameterDescription
<bitmap1>Base BITMAP to be negated
<bitmap2>Exclusion BITMAP to be negated

Return Value​

Returns an integer.

  • If the parameter has a null value, returns NULL

Examples​

select bitmap_and_not_count(null, bitmap_from_string('1,2,3')) banc1, bitmap_and_not_count(bitmap_from_string('1,2,3') ,null) banc2;
+-------+-------+
| banc1 | banc2 |
+-------+-------+
| 0 | 0 |
+-------+-------+
select bitmap_and_not_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5')) banc;
+------+
| banc |
+------+
| 2 |
+------+