@My_Rebecca you could take a look at this article:
If it is a more complicated task of de-duplications window functions are one option: