When I was attempting to apply a PK to a table with a few hundred thousand rows I realized tens of rows had duplicates. I used the following SQL block to remove the duplicates so that I could successfully create the PK.

DELETE x 
FROM (
   SELECT *, rn = row_number() over (partition by <COLUMN_NAMES> ORDER BY (SELECT NULL))
   FROM <TABLE_NAME>
   ) x
WHERE rn > 1;

Replace <COLUMN_NAMES> with the name of your table column(s). If you have more than one column you'd like to dedupe, simply delimit with a comma. And lastly, replace <TABLE_NAME> with your table's name.