Skip to content
Programming101
Programming101

Learn everything about programming

  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programming101

Learn everything about programming

Leetcode Duplicate Emails problem solution

YASH PAL, 31 July 2024

In this Leetcode Duplicate Emails problem solution we need to write a SQL query to find all duplicate emails in a table named Person.

Leetcode Duplicate Emails problem solution

Problem solution in Oracle.

SELECT email
FROM person
GROUP BY email
HAVING COUNT(email) > 1

The > = 2 seems faster. I have no idea why, coudl be pure luck

SELECT email
FROM person
GROUP BY email
HAVING COUNT(email) >= 2

Problem solution in Mysql.

select Email from (select count(distinct Id) , Email
from Person
Group by Email
Having count(distinct ID)>1) a;

Problem solution in C++.

Select Email FROM Person 
Group by Email Having count(Email) > 1

coding problems

Post navigation

Previous post
Next post
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
  • Hackerrank Day 14 scope 30 days of code solution
©2025 Programming101 | WordPress Theme by SuperbThemes