# Find duplicates with RANK

Let's clean out duplicates! Here's how.

1οΈβ£ Check if duplicates exists.
Use πΆππΎππΏ π±π + π²πΎππ½π(*) to find duplicates. See example 1 in image below.

2οΈβ£ Identify exact rows that are duplicated.
Use ππ°π½πΊ πΎππ΄π(πΏπ°πππΈππΈπΎπ½ π±π ππππ). See example 2.

What does ππ°π½πΊ πΎππ΄π(πΏπ°πππΈππΈπΎπ½ π±π ππππ) do?
π divides the table into multiple partitions, one for each unique value of cols, then
π assigns a rank from 1 to the number of rows in the partition, then
π returns more than 1 if the row is duplicated

You can even find duplicated values in TWO columns.

In example 3, I find duplicated show_name and actor_name with this:
ππ°π½πΊ πΎππ΄π(πΏπ°πππΈππΈπΎπ½ π±π ππππ _ππππ, πππππ_ππππ) > π·

As usual, full example below.