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

> Fonction d’agrégation qui calcule les positions des occurrences de la fonction maxIntersections.

# maxIntersectionsPosition

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

Introduite dans : v1.1.0

Fonction d’agrégation qui calcule la position des occurrences de la fonction [`maxIntersections`](/fr/reference/functions/aggregate-functions/maxIntersections).

**Syntaxe**

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

**Arguments**

* `start_column` — Une colonne numérique qui représente le début de chaque intervalle. Si `start_column` vaut `NULL` ou 0, l’intervalle est ignoré. [`(U)Int*`](/fr/reference/data-types/int-uint) ou [`Float*`](/fr/reference/data-types/float)
* `end_column` — Une colonne numérique qui représente la fin de chaque intervalle. Si `end_column` vaut `NULL` ou 0, l’intervalle est ignoré. [`(U)Int*`](/fr/reference/data-types/int-uint) ou [`Float*`](/fr/reference/data-types/float)

**Valeur renvoyée**

Renvoie les positions de début du plus grand nombre d’intervalles qui se chevauchent. [`Any`](/fr/reference/data-types/index)

**Exemples**

**Recherche de la position où les intersections sont maximales**

```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 │
└──────────────────────────────────────┘
```
