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

> Función de agregación que calcula el número máximo de veces que un grupo de intervalos se cruza entre sí (si todos los intervalos se cruzan al menos una vez).

# maxIntersections

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

Introducido en: v20.1.0

Función de agregación que calcula el número máximo de veces que un grupo de intervalos se cruza entre sí (si todos los intervalos se cruzan al menos una vez).

**Sintaxis**

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

**Argumentos**

* `start_column` — Una columna numérica que representa el inicio de cada intervalo. Si `start_column` es `NULL` o 0, se omitirá el intervalo. [`(U)Int*`](/es/reference/data-types/int-uint) o [`Float*`](/es/reference/data-types/float)
* `end_column` — Una columna numérica que representa el final de cada intervalo. Si `end_column` es `NULL` o 0, se omitirá el intervalo. [`(U)Int*`](/es/reference/data-types/int-uint) o [`Float*`](/es/reference/data-types/float)

**Valor devuelto**

Devuelve el número máximo de intervalos que se cruzan. [`UInt64`](/es/reference/data-types/int-uint)

**Ejemplos**

**Cálculo del número máximo de intersecciones**

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