> ## 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.

> Return an intersection of given arrays (Return all items of arrays, that are in all given arrays).

# groupArrayIntersect

<h2 id="groupArrayIntersect">
  groupArrayIntersect
</h2>

Introduced in: v24.2.0

Return an intersection of given arrays (Return all items of arrays, that are in all given arrays).

**Syntax**

```sql theme={null}
groupArrayIntersect(x)
```

**Arguments**

* `x` — Argument (column name or expression). [`Any`](/reference/data-types)

**Returned value**

Returns an array that contains elements that are in all arrays. [`Array`](/reference/data-types/array)

**Examples**

**Usage example**

```sql title=Query theme={null}
-- Create table with Memory engine
CREATE TABLE numbers (
    a Array(Int32)
) ENGINE = Memory;

-- Insert sample data
INSERT INTO numbers VALUES
    ([1,2,4]),
    ([1,5,2,8,-1,0]),
    ([1,5,7,5,8,2]);

SELECT groupArrayIntersect(a) AS intersection FROM numbers;
```

```response title=Response theme={null}
┌─intersection──────┐
│ [1, 2]            │
└───────────────────┘
```
