SelectDB Cloud
SQL 手册
SQL 函数
聚合函数
GROUP_ARRAY_INTERSECT

group_array_intersect

description

Syntax

expr GROUP_ARRAY_INTERSECT(expr)

求出所有行中输入数组中的交集元素,返回一个新的数组

example

mysql> select c_array_string from group_array_intersect_test where id in (18, 20);
+--------------------------------+
| c_array_string                 |
+--------------------------------+
| ["a", "b", "c", "d", "e", "f"] |
| ["a", null]                    |
+--------------------------------+
2 rows in set (0.02 sec)

mysql> select group_array_intersect(c_array_string) from group_array_intersect_test where id in (18, 20);
+---------------------------------------+
| group_array_intersect(c_array_string) |
+---------------------------------------+
| ["a"]                                 |
+---------------------------------------+
1 row in set (0.03 sec)

keywords

GROUP_ARRAY_INTERSECT, ARRAY

© 2023 北京飞轮数据科技有限公司 京ICP备2022004029号 | Apache、Apache Doris 以及相关开源项目名称均为 Apache 基金会商标