title: T-SQL transpose rows to columns based on ID
body: <p>So I have the following table layout:</p>
  <p><a href="https://i.stack.imgur.com/dM6Jh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dM6Jh.png" alt="table layout" /></a></p>
  <p>And I want to &quot;transpose&quot; the data so it looks like this:</p>
  <p><a href="https://i.stack.imgur.com/QLYku.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QLYku.png" alt="enter image description here" /></a></p>
  <p>I tried using pivot but due to the complexity of the data I think it's not enough. Now, I don't want you to create the query for me but I do need an advice or a hint on how to tackle this problem.</p>
  <p>Thanks!</p>