Reputation: 13
I have a list of individual ID keys that have duplicates. I'd like to deduplicate this by counting the instance of each repeated key. I can count the cumulative total, or count the number of repeated instances, but not count incrementally from 1 through x at the next first instance of the ID key.
Example, this is what I'd like to achieve enter image description here
Upvotes: 1
Views: 57
Reputation: 8865
In SQL Query
Select IndividualKey,Row_number()OVER(PARTITION BY IndividualKey ORDER BY (SELECT NULL))ID From Table
Upvotes: 2