this is a nice quick method for removing duplicates in a table. It appears to let me include as many fields as i want to determine what a duplicate is.
Create a common table expression, and select fields, and a row number over some or all fields. If there is more than one row for that selection, the row number will be 1 plus 1++ for each duplicate. remove those with row number greater than 1. I THINK that the order by might allow us to select which one we want to remove, but right now i’m happy with removing ANY duplicates.
, ROW_NUMBER() OVER(
Rnum <> 1