title: SQL Server : find duplicates in a table based on values in a single column
body: <p>I have a SQL Server table with the following fields and sample data:</p>
  
  <pre><code>ID   employeename
  1    Jane
  2    Peter
  3    David
  4    Jane
  5    Peter
  6    Jane
  </code></pre>
  
  <p>The <code>ID</code> column has unique values for each row.</p>
  
  <p>The <code>employeename</code> column has duplicates.</p>
  
  <p>I want to be able to find duplicates based on the <code>employeename</code> column and list the <code>ID</code>s of the duplicates next to them separated by commas.</p>
  
  <p>Output expected for above sample data:</p>
  
  <pre><code>employeename   IDs
  Jane           1,4,6
  Peter          2,5
  </code></pre>
  
  <p>There are other columns in the table that I do no want to consider for this query.</p>
  
  <p>Thanks for all your help!</p>