BITMAP_AND
Descriptionβ
Computes the intersection of two or more input BITMAPs and returns a new BITMAP.
Syntaxβ
BITMAP_AND(<bitmap>, <bitmap>,[, <bitmap>...])
Parametersβ
Parameter | Description |
---|---|
<bitmap> | One of the original BITMAPs whose intersection is being sought |
Return Valueβ
Returns a BITMAP
- If the parameter has a NULL value, it returns NULL
Examplesβ
select bitmap_to_string(bitmap_and(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'))) as res;
+------+
| res |
+------+
| 1,2 |
+------+
select bitmap_to_string(bitmap_and(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'),bitmap_empty())) as res;
+------+
| res |
+------+
| |
+------+
select bitmap_to_string(bitmap_and(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'),NULL)) as res;
+------+
| res |
+------+
| NULL |
+------+