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

INTERSECT_COUNT

デスクリプション

INTERSECT_COUNT関数は、Bitmapデータ構造の交差する要素数を計算するために使用されます。

Syntax

INTERSECT_COUNT(<bitmap_column>, <column_to_filter>, <filter_values>)

パラメータ

パラメータデスクリプション
<bitmap_column>取得する必要がある式。
<column_to_filter>オプション。フィルタリングする必要があるディメンション列。
<filter_values>オプション。フィルタリングディメンション列の異なる値。

Return Value

BIGINT型の値を返します。

Example

select dt,bitmap_to_string(user_id) from pv_bitmap where dt in (3,4);
+------+-----------------------------+
| dt | bitmap_to_string(`user_id`) |
+------+-----------------------------+
| 4 | 1,2,3 |
| 3 | 1,2,3,4,5 |
+------+-----------------------------+
select intersect_count(user_id,dt,3,4) from pv_bitmap;
+----------------------------------------+
| intersect_count(`user_id`, `dt`, 3, 4) |
+----------------------------------------+
| 3 |
+----------------------------------------+