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

> 返回给定数组的交集（即返回所有给定数组中都存在的项）。

# groupArrayIntersect

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

引入于：v24.2.0

返回给定数组的交集 (即返回所有给定数组中共同包含的所有元素) 。

**语法**

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

**参数**

* `x` — 参数 (列名或表达式) 。[`Any`](/zh/reference/data-types/index)

**返回值**

返回一个数组，其中包含所有数组共有的元素。[`Array`](/zh/reference/data-types/array)

**示例**

**使用示例**

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