title: SQL pivot for a rows that have multiple attribute name in one column and multiple values in another rows in another column
body: <p>I have one column whose rows are formatted with attributenames and another columns have with values, such </p>
  
  <pre><code>SourceTechAttributesName
  MediaFormat, FrameRate, DropFrame, StartSmpte
  MediaFormat, FrameRate, DropFrame, StartSmpte
  MediaFormat, FrameRate, DropFrame, StartSmpte
  MediaFormat, NativeFrameRate, ActionType, ViewportDisplayFormat, ViewportAspectRatio, FrameRate, Width, Height, ScanType, FieldDominance, DropFrame, NativeFieldOrder, CadencePattern, NumberOfAudioChannels, NumberOfAudioTracks, StartSmpte, Duration
  MediaFormat, NativeFrameRate, ActionType, ViewportDisplayFormat, ViewportAspectRatio, FrameRate, Width, Height, ScanType, FieldDominance, DropFrame, NativeFieldOrder, CadencePattern, NumberOfAudioChannels, NumberOfAudioTracks, StartSmpte, Duration
  </code></pre>
  
  <p>And Another column has values such as </p>
  
  <p>SourceTechAttributesValue</p>
  
  <pre><code>96, 29.97, False, 00:00:00:00
  96, 29.97, False, 00:00:00:00
  96, 29.97, False, 00:00:00:00
  645, 23.98, Live Action, Anamorphic, 1.78:1 (16x9), 23.98, 1920, 1080, Progressive, Lower Field First, False, Progressive, 2-2, 12, 12, 00:59:35:00, 1507.380875
  645, 23.98, Live Action, Anamorphic, 1.78:1 (16x9), 23.98, 1920, 1080, Progressive, Lower Field First, False, Progressive, 2-2, 12, 12, 00:59:35:00, 1507.380875
  </code></pre>
  
  <p>I want to have pivot out that in below format</p>
  
  <pre><code>srcMediaFormat srcFrameRate srcDropFrame srcWidth srcHeight srcCodec srcDuration
      96           29.97       FALSE              
      644          23.98       FALSE        1920     1080               1646.645
      644          23.98       FALSE        1920     1080               1626.625
  </code></pre>
  
  <p>I know how to do if there only one attribute would have in that column and one value in different column such as </p>
  
  <pre><code>pivot
  (
      max(SourceTechAttributeValue)
      for SourceTechAttributeName in ([srcMediaFormat],[srcFrameRate],[srcDropFrame],[srcWidth],[srcHeight],[srcCodec],[srcDuration])
  
      )piv
  </code></pre>
  
  <p>But because of each column has multiple attributeName and attributValue, I cannot able to achieve my goal.I want to be result out like below</p>
  
  <pre><code>srcMediaFormat srcFrameRate srcDropFrame srcWidth srcHeight srcCodec srcDuration
          96           29.97       FALSE              
          644          23.98       FALSE        1920     1080               1646.645
          644          23.98       FALSE        1920     1080               1626.625
  </code></pre>
  
  <p>Can anyone please help me to accomplish this achievement.Thanks </p>