Hello
I have the below requirement.
col1(key) col2 col3 col4
1 A B C
1 D E F
1 G H I
1 J K L
2 M N O
2 P Q R
2 S T Q
2 U V W
based on the key column i need to concatenate col3 values. the output should be as below
col1 col2
1 BEHK
2 NQTV
any ideas would be appreciated.
Thanks
concatenate the rows
Moderators: chulett, rschirm, roy
Hello Chulett,chulett wrote:That would be a horizontal pivot of rows to columns, search for that phrase here to find the many (many) conversations we've already had on the topic.
Thanks for the reply.i looked at the horizontal pivot pdf but my requirement seems to be different. My aim is based on the key (col1) from the source i need to concatenate col3 values from the source which are varchar datatype . so i am expecting the output as
1 BEHK
2 NQTV
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Pivot first, concatenate later. A good rule to remember in parallel job design is "one stage, one task". That's why there are so many more stage types in the parallel job Palette than in the server or mainframe job Palettes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.