Duplicates Across Multiple Columns
Medium
Duplicates & Deduplication
Two people are duplicates when first_name, last_name and birth_date all match. Return these combinations with how many times they occur, ordered by last_name.
Table schema
People(id INT PRIMARY KEY, first_name VARCHAR(20), last_name VARCHAR(20), birth_date DATE)Sample data
id | first_name | last_name | birth_date
1 | Ann | Rao | 1990-01-01
2 | Ann | Rao | 1990-01-01
3 | Ann | Rao | 1991-02-02
4 | Raj | Das | 1985-05-05
5 | Raj | Das | 1985-05-05
6 | Raj | Das | 1985-05-05
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.