SELECT RECNO() as recno, xpat.patid, xpat.lastname, xpat.firstname ; FROM xpat ; JOIN ( ; SELECT xpat.patid, COUNT(*) AS nCount ; FROM xpat ; GROUP BY patid HAVING nCount > 1) Dups ; ON xpat.patid = Dups.patid ; ORDER BY xpat.patid, xpat.lastname ; INTO CURSOR HasDups Join Dups and delete all but lowest record number