start_range and end_range (exclusive). The output elements are a subset of the Bitmap value.
This function is mainly used for scenarios such as paginated queries. It is supported from v3.1.
Syntax
Parameters
src: the Bitmap value from which to obtain elements.start_range: the start range to intercept elements. It must be a BIGINT value. If the specified start range exceeds the maximum length of the BITMAP value, NULL is returned. See Example 4.end_range: the end range to intercept elements. It must be a BIGINT value. Ifend_rangeequals or is less thanstart range, NULL is returned. See Example 3.
Return value
Returns a value of the BITMAP type. NULL is returned if any of the input parameters is invalid.Usage notes
The subset elements includestart_range but exclude end_range. See Example 5.
Examples
In the following examples, the input of bitmap_subset_in_range() is the output of bitmap_from_string. For example,bitmap_from_string('1,1,3,1,5,3,5,7,7,9') returns 1, 3, 5, 7, 9. bitmap_subset_in_range() takes this BITMAP value as the input.
Example 1: Obtain subset elements from the BITMAP value with elements values in the range of 1 to 4. The values within this range are 1 and 3.
3 is less than the start range 4.
1,3,5,7,9. NULL is returned.
1 but excludes the end value 3.