Last answered:

05 Aug 2023

Posted on:

04 Aug 2023

1

Resolved: please i need an aswer

i want to understand how i can find duplicates , how i can find if my data have duplicates which i am not aware about it?

2 answers ( 2 marked as helpful)
Instructor
Posted on:

05 Aug 2023

3

Hi Mustafa!

This is a task you will need to solve frequently. Here's how to do it in different cases:


1. Finding duplicates in a single column:

Suppose you have a table students and you want to find duplicate student names:

 

SELECT name, COUNT(name) AS CountOf
FROM students
GROUP BY name
HAVING COUNT(name) > 1;

2. Finding duplicates across multiple columns

Suppose you want to find duplicates based on the name and age columns in the students table:

 

SELECT name, age, COUNT(*) AS CountOf
FROM students
GROUP BY name, age
HAVING COUNT(*) > 1;
Posted on:

05 Aug 2023

0

thanks so much. that so helpful

Submit an answer