8 Replies Latest reply: Aug 8, 2014 9:10 AM by Charlie Hudson RSS

    Trying to convert multiple rows into one row and multiple columns

      Hi

       

      I have two tables which contain linked information but have been asked to present in a fashion which I am struggling with. Below are the two tables and what I am being asked for.


      Any advice or guidance would be greatly appreciated.

       

      #1 Flight Records

      IDFlight NumberSTD
      1AA00109:00
      2AA22209:30
      3AA04909:45
      4AA012

      10:00

       

      #2 Delay Table

      IDDelay CodeDelay Time
      19300:10
      18500:05
      11300:01
      29300:23
      2500:10
      3800:01
      49300:10
      41000:02
      41900:05
      42100:14

       

      And this is what we would like to get as an output ideally from the load script:

       

      IDFlight NumberSTDDelay Code 1Delay Code 1 TimeDelay Code 2Delay Code 2 TimeDelay Code 3Delay Code 3 TimeDelay Code 4Delay Code 4 Time
      1AA00109:009300:108500:051300:01
      2AA22209:309300:23500:23
      3AA04909:45800:01
      4AA01210:0093101000:021900:052100:14