>select KeyID, count(*) as CntDups from yourtable group by KeyID ; > having CntDups > 1 ; > into cursor curDupes >index on KeyID tag KeyID >select yourtable >set relation to KeyID into curDupes >delete for found('curDupes') && One of the dupes would be deletedUnfortunately, this code would delete all duplicate records not just one of them.