代码之家  ›  专栏  ›  技术社区  ›  user8834780

listagg(distinct column)over()。

  •  0
  • user8834780  · 技术社区  · 6 年前

    有其他选择吗 listagg(distinct column) over() 这是受支持的-一些不能按其余列分组的内容?我有20 +…

    1 回复  |  直到 6 年前
        1
  •  1
  •   Gordon Linoff    6 年前

    子查询可用于 row_number() 确定要包含在 listagg() ,例如:

    select listagg(case when seqnum = 1 then column end) within group (order by column) over (order by ?)
    from (select t.*, row_number() over (partition by column order by column) as seqnum
          from t
         ) t