select KeyFld, count(*) as CntDups from TestDups group by 1 ; having CntDups > 1 ; into cursor curDupes