title: Pivot on multiple aggregated columns
body: <p>I cannot wrap my head around the following issue. My table structure:</p>
  
  <pre><code>ID Type Price Currency
  1   A    100    USD
  1   B    200    EUR
  1   C    300    CAD
  2   A    400    EUR
  2   B    500    EUR
  2   C    600    USD
  </code></pre>
  
  <p>I need to get the following result:</p>
  
  <pre><code>ID   A  A_Currency B    B_Currency  C C_Currency  
   1  100    USD     200    EUR      300    CAD
   2  400    EUR     500    EUR      600    USD  
  </code></pre>
  
  <p>At this point I was able to successfully produce table without currencies like this: </p>
  
  <pre><code>select ID, p.A, p.B, p.C from 
  (select ID, Price, Type from MyTable) as x
  pivot(Max(Price) for Type in 
  (A, B, C)) as p
  </code></pre>
  
  <p>And it works great. But now I'm really lost on how to add Currency for each type. I tried to put it in select but then it doesn't work and PIVOT doesn't accept multiple columns.</p>