title: How to delete duplicate rows in Oracle
body: <p>I need help with duplicate rows. I have deleted the duplicate rows from one table using the following method</p>
  
  <pre><code>DELETE FROM names a
  WHERE ROWID &gt; (SELECT MIN(ROWID) FROM names b
  WHERE b.name=a.name
  AND b.age=a.age
  );
  </code></pre>
  
  <p>It did work with that particular table but I did the same thing with another table which has duplicate reference numbers for each doctor but different unique codes.</p>
  
  <pre><code>doc_name  ref_no  unique_code
  ------------------------------
  abcd      1010     1111
  abcd      1010     1112
  cdef      1011     1113
  cdef      1011     1114
  </code></pre>
  
  <p>My result should look like this:</p>
  
  <pre><code>doc_name ref_no unique_code
  ---------------------------
  abcd     1010      1111
  cdef     1011      1113
  </code></pre>