Results 1 to 3 of 3

Thread: DB2 Sql Select

  1. #1
    Join Date
    Aug 2011
    Posts
    4

    Unanswered: DB2 Sql Select

    Hi I have a table which looks like this:

    Nr Name1 Name2
    == ===== =====
    1--John---------
    1----------Smith
    2--Ricky--------
    2----------Fred
    2----------Mason
    3--Steve--------


    The result shoudl look like this:

    Nr Name1 Name2 Name3
    == ===== ===== =====
    1 John Smith
    2 Ricky Fred Mason
    3 Steve

    I already tried to use a temprary global table
    and reverse query but I wasn't able to solve this problem.
    I think it could be possible to solve it with reverse query,
    if someone has an idea how to solve, please let me know.

    Thanks a lot.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    maybe this link can help
    Unpivot Query
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Aug 2011
    Posts
    4
    Thank you for the tip, it workes!

Tags for this Thread

Posting Permissions

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