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

BITMAP_AND_NOT_COUNT,BITMAP_ANDNOT_COUNT

デスクリプション

2つのBITMAPに対してNOT演算を実行し、結果セット内の要素数を返します。最初の入力パラメータはbase BITMAPと呼ばれ、2番目はexclusion BITMAPと呼ばれます。

Alias

  • BITMAP_ANDNOT_COUNT

Syntax

BITMAP_AND_NOT_COUNT(<bitmap1>, <bitmap2>)

パラメータ

Parameterデスクリプション
<bitmap1>否定されるベースBITMAP
<bitmap2>否定される除外BITMAP

戻り値

整数を返します。

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

select bitmap_and_not_count(NULL, bitmap_from_string('1,2,3')) banc1, bitmap_and_not_count(bitmap_from_string('1,2,3'), NULL) banc2;
+-------+-------+
| banc1 | banc2 |
+-------+-------+
| 0 | 0 |
+-------+-------+
select bitmap_and_not_count(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5')) banc;
+------+
| banc |
+------+
| 2 |
+------+