select invoice_num, count(*) as ncnt ; from mytable ; group by invoice_num ; having count(*) > 1 ; into cursor cudupesWhich dupe to delete is another question. Assuming for this example that you want to keep the first entry of an invoice number and delete the rest:
SELECT mytable SET ORDER TO invoice_no && assuming there is an index on this, at least SELECT cudupes SCAN lcInv = invoice_no =SEEK(lcInv, "mytable") SKIP IN mytable DELETE WHILE invoice_no = lcInv IN mytable ENDSCANFor the future, I would suggest making the invoice_num index a CANDIDATE key, then trap for any candidate key violations when creating new invoice numbers.