Aggregate Concatenation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • btakacs
    New Member
    • Jul 2008
    • 2

    Aggregate Concatenation

    Hi

    Could anybody help me to create some kind of Generic Aggregate concatenation in db2?

    I have tables that holds this kind of data:
    "dog" "big"
    "dog" "strong"
    "cat" "quick"
    "dog" "big"

    I would need a result like this:
    "dog" "big, strong"
    "cat" "quick"

    I would like to use it for different tables, so the solution would be generic. Mainly I would need to convert (concatenate) a list to a scalar value (comma separated varchar) with handling repetitions.

    Thanks:
    Bence
  • JoshuaL
    New Member
    • Jul 2008
    • 1

    #2
    I see this question a lot, so once the answer is ironed out we'll have to add it to the FAQ for DB2. I imagine the solution will involve a temporary table housing the initial results...

    Comment

    • btakacs
      New Member
      • Jul 2008
      • 2

      #3
      Originally posted by JoshuaL
      I see this question a lot, so once the answer is ironed out we'll have to add it to the FAQ for DB2. I imagine the solution will involve a temporary table housing the initial results...
      So you have a generic solution for that? I mean I can create all kinds of subqueries, which has a column (with fields of string) as a result, and I can give this result to your code particle, and it will concatenate the items?

      Could you post here the solution, or a link to that?

      Comment

      Working...