title: how to select all duplicates efficiently
body: <p>I want to select all rows that have a value that already exists in the table. I did not find a better solution than</p>
  
  <pre><code>select * 
  from provisioning_requests tt 
  where code in (select code 
                 from provisioning_requests tt2 
                 where tt2.id &lt;&gt; tt.id)
  </code></pre>
  
  <p>This seems a bit naive. Does anybody have a better solution?</p>