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β
Parameter | Description |
---|---|
<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 |
+------+