title: T-SQL How to select rows without duplicate values from one column?
body: <p>I have a table with 2 columns <code>ID, ID_PROJ_CSR</code></p>
  
  <p>The content of that table is:</p>
  
  <pre><code>ID     ID_PROJ_CSR
  ------------------
  747    222   &lt;
  785    102
  786    222   &lt;
  787    223
  788    224
  </code></pre>
  
  <p>I want to select the ID, but if any value from ID_PROJ_CSR is a duplicate, I need to select any ID of the rows that contains that duplicate value (in that example, select ID <strong>747</strong> OR <strong>786</strong></p>
  
  <p>I try:</p>
  
  <pre><code>SELECT * FROM my_table tab 
  WHERE tab.id_proj_csr = (SELECT TOP 1 id_proj_csr
                           FROM my_table mt
                           WHERE mt.id_proj_csr = tab.id_proj_csr)
  </code></pre>