title: How to convert row to column in SQL?
body: <p>I have a stored procedure (join two tables and select where condition <code>@GID</code>), a want to convert table result from rows to columns. I use a dynamic pivot query. </p>
  
  <p>My stored procedure:</p>
  
  <p><img src="https://i.stack.imgur.com/u9BbY.png" alt="enter image description here"></p>
  
  <p>After I try using pivot</p>
  
  <p><img src="https://i.stack.imgur.com/U6a8y.png" alt="enter image description here"></p>
  
  <p>I want result like this:</p>
  
  <pre><code>GROUP_MOD_ID   ADD  EDIT  DELETE  ETC...
  ---------------------------------------    
  G02            1     1    0      ....
  </code></pre>
  
  <p>Can you give me some advice about this ?</p>
  
  <p>Thank you.</p>