Skip to main content

BITMAP_AND

Description

Computes the intersection of two or more input BITMAPs and returns a new BITMAP.

Syntax

BITMAP_AND(<bitmap>, <bitmap>,[, <bitmap>...])

Parameters

ParameterDescription
<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 |
+------+