최종 수정: 에
BITMAP_AND_COUNT
설명
두 개 이상의 입력 BITMAP의 교집합을 계산하고 교집합에 포함된 원소 수를 반환합니다.
구문
BITMAP_AND_COUNT(<bitmap>, <bitmap>,[, <bitmap>...])
매개변수
| 매개변수 | 설명 |
|---|---|
<bitmap> | 교집합을 구할 원본 BITMAP 중 하나 |
반환 값
정수를 반환합니다.
- 매개변수 값이 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 |
+------+