github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_aggr_group_concat.result (about)

     1  drop table if exists t1;
     2  create table t1(a int,b text,c text);
     3  insert into t1 values(1,"a","bc"),(2,"ab","c"),(3,"aa","bb"),(3,"aa","bb");
     4  select group_concat(distinct a,b,c separator '|') from t1;
     5  group_concat(distinct a, b, c, |)
     6  1abc|2abc|3aabb
     7  select group_concat(distinct b,c separator '|') from t1 group by a;
     8  group_concat(distinct b, c, |)
     9  abc
    10  abc
    11  aabb
    12  select group_concat(distinct b,c separator '|') from t1;
    13  group_concat(distinct b, c, |)
    14  abc|abc|aabb
    15  set @@sql_mode = "STRICT_TRANS_TABLES";
    16  select group_concat(distinct b,c separator '|'),a from t1;
    17  group_concat(distinct b, c, |)    a
    18  abc|abc|aabb    1
    19  select a,group_concat(distinct b,c separator '|') from t1;
    20  a    group_concat(distinct b, c, |)
    21  1    abc|abc|aabb
    22  select group_concat(distinct b,c separator '|'),avg(a) from t1;
    23  group_concat(distinct b, c, |)    avg(a)
    24  abc|abc|aabb    2.25
    25  select avg(a),group_concat(distinct b,c separator '|') from t1;
    26  avg(a)    group_concat(distinct b, c, |)
    27  2.25    abc|abc|aabb
    28  select group_concat(distinct b,c separator '|'),sum(a) from t1;
    29  group_concat(distinct b, c, |)    sum(a)
    30  abc|abc|aabb    9
    31  select sum(a),group_concat(distinct b,c separator '|') from t1;
    32  sum(a)    group_concat(distinct b, c, |)
    33  9    abc|abc|aabb
    34  select group_concat(distinct b,c separator '|'),a from t1 group by a;
    35  group_concat(distinct b, c, |)    a
    36  abc    1
    37  abc    2
    38  aabb    3
    39  select a,group_concat(distinct b,c separator '|') from t1 group by a;
    40  a    group_concat(distinct b, c, |)
    41  1    abc
    42  2    abc
    43  3    aabb
    44  select group_concat(distinct b,c separator '|'),avg(a) from t1 group by a;
    45  group_concat(distinct b, c, |)    avg(a)
    46  abc    1.0
    47  abc    2.0
    48  aabb    3.0
    49  select avg(a),group_concat(distinct b,c separator '|') from t1 group by a;
    50  avg(a)    group_concat(distinct b, c, |)
    51  1.0    abc
    52  2.0    abc
    53  3.0    aabb
    54  select group_concat(distinct b,c separator '|'),sum(a) from t1 group by a;
    55  group_concat(distinct b, c, |)    sum(a)
    56  abc    1
    57  abc    2
    58  aabb    6
    59  select sum(a),group_concat(distinct b,c separator '|') from t1 group by a;
    60  sum(a)    group_concat(distinct b, c, |)
    61  1    abc
    62  2    abc
    63  6    aabb
    64  drop table if exists t1;
    65  create table t1(a int, b char(1));
    66  insert into t1 values (1, 'a');
    67  select group_concat(a) as bb, case b when 1 then '是' else '否' end aa from t1;
    68  invalid argument cast to int, bad value a
    69  select group_concat(b) as bb, case a when 1 then '是' else '否' end aa from t1;
    70  bb    aa
    71  a    是
    72  set @@sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION";