title: Add join results as new column based on values from join
body: <p>I've never done something like this, and I tried finding it on google but without result.</p>
  
  <p>I have 3 tables that look like this:</p>
  
  <p><strong>Orders:</strong></p>
  
  <pre><code>OdredID (int) PK,
  UserID (int) FK,
  OdredDate (datetime)
  </code></pre>
  
  <p><strong>Components:</strong></p>
  
  <pre><code>ComponentID (int) PK,
  Name (nvarchar(50)),
  Type (nvarchar(max))
  </code></pre>
  
  <p><strong>OrderComponent:</strong></p>
  
  <pre><code>OrderComponentID (int) PK,
  OrderID (int) FK,
  ComponentID (int) FK,
  Value (nvarchar(max))
  </code></pre>
  
  <p>Lets say one order has 3 components with names: <code>[CPU, Motherboard, Memory]</code> and values <code>[1GHz, AsusP5, 2GB Kingston DDR3]</code></p>
  
  <p>I need a result has columns like this:</p>
  
  <pre><code>OrderID  UserID   Date          CPU    Motherboard   Memory
     1        1     2012-05-21    1GHz   AsusP5        2GB Kingston DDR3
  </code></pre>
  
  <p>Basically I need every join row to go as new column with name taken from <code>Name</code> column of join table and value from <code>Value</code> column.</p>