메인 콘텐츠로 건너뛰기

maxIntersectionsPosition

도입 버전: v1.1.0 maxIntersections 함수의 출현 위치를 계산하는 집계 함수입니다. 구문
maxIntersectionsPosition(start_column, end_column)
인수
  • start_column — 각 인터벌의 시작을 나타내는 숫자 컬럼입니다. start_columnNULL 또는 0이면 해당 인터벌은 무시됩니다. (U)Int* 또는 Float*
  • end_column — 각 인터벌의 끝을 나타내는 숫자 컬럼입니다. end_columnNULL 또는 0이면 해당 인터벌은 무시됩니다. (U)Int* 또는 Float*
반환 값 가장 많은 인터벌이 교차하는 시작 위치를 반환합니다. Any 예시 최대 교차 지점 찾기
Query
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 maxIntersectionsPosition(start, end) FROM my_events;
Response
┌─maxIntersectionsPosition(start, end)─┐
│                                    2 │
└──────────────────────────────────────┘
마지막 수정일 2026년 6월 10일