BITMAP_HAS_ALL
Descriptionβ
Determines whether one Bitmap contains all the elements of another Bitmap.
Syntaxβ
BITMAP_HAS_ALL(<bitmap1>, <bitmap2>)
Parametersβ
Parameter | Description |
---|---|
<bitmap1> | The first Bitmap |
<bitmap2> | The second Bitmap |
Return Valueβ
Returns true
if <bitmap1>
contains all the elements of <bitmap2>
;
Returns true
if <bitmap2>
contains no elements;
Otherwise, returns false
.
Examplesβ
To check if one Bitmap contains all elements of another Bitmap:
select bitmap_has_all(bitmap_from_string('0, 1, 2'), bitmap_from_string('1, 2'));
The result will be:
+---------------------------------------------------------------------------+
| bitmap_has_all(bitmap_from_string('0, 1, 2'), bitmap_from_string('1, 2')) |
+---------------------------------------------------------------------------+
| 1 |
+---------------------------------------------------------------------------+
To check if an empty Bitmap contains all elements of another Bitmap:
select bitmap_has_all(bitmap_empty(), bitmap_from_string('1, 2'));
The result will be:
+------------------------------------------------------------+
| bitmap_has_all(bitmap_empty(), bitmap_from_string('1, 2')) |
+------------------------------------------------------------+
| 0 |
+------------------------------------------------------------+