Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Duplicates Across Multiple Columns

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.