Results 1 to 2 of 2

Thread: SQL Help

  1. #1
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130

    Unanswered: SQL Help

    We have two tables.
    Code:
    Table1
    Col1    
     1         
     2
    
    Table2
    Col1     Col2
    1          1
    2          1
    3          1
    4          1
    5          1
    1          2
    2          2
    Tables can be joined with Tab1-> col1 with Tabl2->Col2. I need to get the out put of the data some thing like this

    Code:
    Table1    Table2         Table2  Table2   Table2  Table2   Table2
    Col1         Col2            Col1      Col1     Col1      Col1      Col1
    1               1               1           2         3          4          5
    2               2               1           2
    Is this some thing can be done through SQL? We are in DB2 z/OS V9.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    search in this forum for pivot.. there are many samples for this..
    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

Posting Permissions

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