• If you want to filter duplicate, just use group by clause to filter duplicate row.

    select column_name, min(PK_Column_name) PrimaryKeyColumn from tablename group by column_name having count(*)>1

    The above script will identify duplicate value and show minimum Primary key value. If you intend to keep one row, you can keep the minimum Primary key value row. (of course you can change the condition)

    The below will delete all duplicate rows and leaving one distinct value row(minimum Primary key value row)

    with Tempinfo (columename, PrimaryKeyColumn)

    as

    (select column_name, min(PK_Column_name) PrimaryKeyColumn from tablename group by column_name having count(*)>1)

    delete a

    from tablename a join Tempinfo b on a.column_name=b.column_name and a.PrimaryKeyColumn<>b.PrimaryKeyColumn