title: Duplicates without using While or Cursor in T-SQL
body: <pre><code>ID           Name
  1            A
  1            B
  1            C
  2            X
  2            Y
  3            P
  3            Q
  3            R
  </code></pre>
  
  <p>These are the columns in a table. I want to get output like </p>
  
  <pre><code>ID    Company
      1 A,B,C
      2 X, Y
      3 P,Q,R
  </code></pre>
  
  <p>Restriction is that I cannot use WHILE or CURSOR. Please write a query for the same.</p>