Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone explain how to count the duplicate values in SQL?

1 Answer

0 votes
by (119k points)

We can use Group By and Having clauses to count the duplicate values in SQL. Here is the SQL query to count the duplicate values in a column of the table:

SELECT Column_name, COUNT(*) as Count_Duplicate

FROM Table_name

GROUP BY Column_name

HAVING COUNT(*) > 1

ORDER BY COUNT(*) DESC

If you want to be expert in writing SQL queries, you can learn by enrolling in SQL Certification program by Intellipaat that provides Instructor-led training, certification, and also job assistance.

Related questions

+1 vote
1 answer
asked Jun 26, 2019 in SQL by Tech4ever (20.3k points)
0 votes
3 answers
asked Nov 28, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
asked May 3, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Apr 20, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Apr 21, 2020 in SQL by Sudhir_1997 (55.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...