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