メインコンテンツまでスキップ
バージョン: 26.x

BITMAP_AND_COUNT

説明

2つ以上の入力BITMAPの積集合を計算し、積集合の数を返します。

構文

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

パラメータ

Parameterデスクリプション
<bitmap>積集合を求める対象となる元のBITMAPの1つ

戻り値

整数を返します

  • パラメータがNULL値の場合、0を返します

select bitmap_and_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')) as res;
+------+
| res |
+------+
| 1 |
+------+
select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5')) as res;
+------+
| res |
+------+
| 2 |
+------+
select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'),bitmap_empty()) as res;
+------+
| res |
+------+
| 0 |
+------+
select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'), NULL) as res;
+------+
| res |
+------+
| 0 |
+------+