Coalescing values in a column over a partition

前端 未结 3 1732
悲哀的现实
悲哀的现实 2021-01-06 18:45

I have chosen to ask this question via an example as I think it most clearly illustrates what I am trying to do.

Say I have the following table:

mem         


        
3条回答
  •  隐瞒了意图╮
    2021-01-06 19:10

    depending on your version of db2, the LISTAGG() function may be available to you. i think it is included in any db2 version after 9.7.

    example:

    select
      member,
      number,
      listagg(number,',') as new_column
    from
      tablename
    group by
      member
    

提交回复
热议问题