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

> Função de agregação que calcula as posições das ocorrências da função maxIntersections.

# maxIntersectionsPosition

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

Introduzido em: v1.1.0

Função de agregação que calcula as posições em que ocorrem os valores da função [`maxIntersections`](/pt-BR/reference/functions/aggregate-functions/maxIntersections).

**Sintaxe**

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

**Argumentos**

* `start_column` — Uma coluna numérica que representa o início de cada intervalo. Se `start_column` for `NULL` ou 0, o intervalo será ignorado. [`(U)Int*`](/pt-BR/reference/data-types/int-uint) ou [`Float*`](/pt-BR/reference/data-types/float)
* `end_column` — Uma coluna numérica que representa o fim de cada intervalo. Se `end_column` for `NULL` ou 0, o intervalo será ignorado. [`(U)Int*`](/pt-BR/reference/data-types/int-uint) ou [`Float*`](/pt-BR/reference/data-types/float)

**Valor retornado**

Retorna as posições iniciais em que ocorre o número máximo de interseções entre intervalos. [`Any`](/pt-BR/reference/data-types)

**Exemplos**

**Encontrando a posição com o máximo de interseções**

```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 maxIntersectionsPosition(start, end) FROM my_events;
```

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