• In most of the cases you need to retain the latest record from the duplicates. In that case matching rank=rownumber will not work.

    So using ROW_NUMBER() partition and ORDER BY col DESC is always a good approach.