BITMAP_SUBSET_IN_RANGE
Descriptionβ
Returns a subset of the Bitmap within the specified range (excluding the range end).
Syntaxβ
BITMAP_SUBSET_IN_RANGE(<bitmap>, <range_start_include>, <range_end_exclude>)
Parametersβ
Parameter | Description |
---|---|
<bitmap> | The Bitmap value |
<range_start_include> | The start of the range (inclusive) |
<range_end_exclude> | The end of the range (exclusive) |
Return Valueβ
A subset Bitmap within the specified range.
Examplesβ
To get a subset of a Bitmap within the range 0 to 9:
select bitmap_to_string(bitmap_subset_in_range(bitmap_from_string('1,2,3,4,5'), 0, 9)) value;
The result will be:
+-----------+
| value |
+-----------+
| 1,2,3,4,5 |
+-----------+
To get a subset of a Bitmap within the range 2 to 3:
select bitmap_to_string(bitmap_subset_in_range(bitmap_from_string('1,2,3,4,5'), 2, 3)) value;
The result will be:
+-------+
| value |
+-------+
| 2 |
+-------+