How to join two or more rows from single table and put them in one column in DB2 (AS/400 Platform)

10 pts.
Tags:
AS/400
DB2
How to join two or more rows from single table and put them in one column in DB2 (AS/400 Platform) TABLE Name : EDITBL COLUMN 1   : EDIVND COLUMN 2   : EDITYP
Data:
Vendor Number  EDI Type
1019      810I
1028      852O
1535      FAXO
1546      FAXO
1612      FAXO
1678      753O
1678      754I
1678      810I
1678      850O
1678      855I
1678      856I
1678      860O
I need in this format
Data:
Vendor Number  EDI Type
1019      810I
1028      852O
1535      FAXO
1546      FAXO
1612      FAXO
1678      753O, 754I, 810I, 8500


Software/Hardware used:
AS400
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • philpl1jb
    Easy in RPGLE to create a new table .. is that what you're after?
    54,090 pointsBadges:
    report
  • philpl1jb

    perhaps this question links to your previous question ..  LISTAGG

    so perhaps you're looking for an SQL way to produce this result. 

    Here is another discussion on this issue

    https://itknowledgeexchange.techtarget.com/itanswers/string-aggregate-function/

    54,090 pointsBadges:
    report
  • ToddN2000
    How do you plan on doing it SQL,RPGLE or other language? If I understand if a vendor ID has more than 1 type in the new table you want all found types from table 1 in the new row with a comma delimiter?
    131,380 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: