> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-1d264819.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 인터벌 그룹에서 서로 겹치는 최대 횟수를 계산하는 집계 함수입니다(모든 인터벌이 적어도 한 번 이상 서로 겹치는 경우).

# maxIntersections

<div id="maxIntersections">
  ## maxIntersections
</div>

도입 버전: v20.1.0

인터벌 그룹이 서로 겹치는 최대 횟수를 계산하는 집계 함수입니다(모든 인터벌이 최소 한 번 이상 서로 겹치는 경우).

**구문**

```sql theme={null}
maxIntersections(start_column, end_column)
```

**인수**

* `start_column` — 각 인터벌의 시작을 나타내는 숫자 컬럼입니다. `start_column`이 `NULL`이거나 0이면 해당 인터벌은 건너뜁니다. [`(U)Int*`](/ko/reference/data-types/int-uint) 또는 [`Float*`](/ko/reference/data-types/float)
* `end_column` — 각 인터벌의 끝을 나타내는 숫자 컬럼입니다. `end_column`이 `NULL`이거나 0이면 해당 인터벌은 건너뜁니다. [`(U)Int*`](/ko/reference/data-types/int-uint) 또는 [`Float*`](/ko/reference/data-types/float)

**반환 값**

겹치는 인터벌의 최대 개수를 반환합니다. [`UInt64`](/ko/reference/data-types/int-uint)

**예시**

**최대 겹침 개수 계산**

```sql title=Query theme={null}
CREATE TABLE my_events (
    start UInt32,
    end UInt32
)
ENGINE = MergeTree
ORDER BY tuple();

INSERT INTO my_events VALUES
(1, 3),
(1, 6),
(2, 5),
(3, 7);

SELECT maxIntersections(start, end) FROM my_events;
```

```response title=Response theme={null}
┌─maxIntersections(start, end)─┐
│                            3 │
└──────────────────────────────┘
```
