• So if we include both ID and keyvalue columns in the over() clause we will delete only non-unique rows:

    The angle you derive with the "Partition by" clause is literally a "partition" of a particular cluster of fields defined uniquely. If you prefer, then also, use only the "order by" portion of the clause and create a numeric cluster("PK" ID ) that is dynamic [rather than static].

    Select rowno=Row_Number() over(Order by mychoiceofID,2ndchoice,etcchoice), * from mytable.

    Jamie