Sriv
asked on
Delete Duplicates
Hi I have a table and need to identify duplicates by creating an unique key by concatenating col1+Col2+col3 and then keep last occurring duplicate for each group of duplicates.
How can we achieve this?
How can we achieve this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ok, what is the definition of first record and last in your table?
ASKER
Mate the above solution that you provided find duplicates and keeps first occurring (Ranked 1) duplicate and deletes other duplicates but my requirement is to keep the last ranked duplicate. We also have ID column which is identity column. We need to find the duplicates and then based on each duplicate group we need to keep the duplicate that has max ID column
ASKER