I need help with duplicate rows. I have deleted the duplicate rows from one table using the following method
DELETE FROM names a
WHERE ROWID > (SELECT MIN(ROWID) FROM names b
WHERE b.name=a.name
AND b.age=a.age
);
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.
doc_name ref_no unique_code
------------------------------
abcd 1010 1111
abcd 1010 1112
cdef 1011 1113
cdef 1011 1114
My result should look like this:
doc_name ref_no unique_code
---------------------------
abcd 1010 1111
cdef 1011 1113