Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

groupArrayIntersect

groupArrayIntersect

قُدِّمت في: v24.2.0

ترجع تقاطع المصفوفات المحددة (أي جميع عناصر المصفوفات المشتركة بين جميع المصفوفات المحددة).

الصيغة

groupArrayIntersect(x)

الوسيطات

  • x — وسيطة (اسم العمود أو تعبير). Any

القيمة المُعادة

تعيد مصفوفةً تحتوي على العناصر الموجودة في جميع المصفوفات. Array

أمثلة

مثال على الاستخدام

-- 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;
┌─intersection─┐
│ [1,2]        │
└──────────────┘
Navigation