Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Posts
    4

    Unanswered: DB2 Query Question

    I was hoping someone could help me out with this.

    I have table columns like this

    CALLID PatternId (these are the ones I care about for this example)

    Data could be

    1111 02
    1111 333
    1111 05
    1111 02
    1234 01
    1234 02
    1234 122
    2222 243
    2222 76


    I want to process the table and get a result set like this

    1111 02-222-05-02
    1234 01-02-122
    2222 243-76

    there could be up to 200 rows per callid.

    IS there a way to write a query in DB2 to accomplish this??

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Yes. This question gets asked at least once a month. Search the forum for "pivot table". There are numerous examples.

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •