Sql Query to find duplicates in a table or column

80
Views
2
Answers

How to find duplicates in a table or in a column in SQL?

edit | flag
William Patrick
Asked on: Jun 28, 2011 at 1:47AM

2 Answers

44
4
44

Try this Query..

SELECT column,COUNT(*) c FROM table
GROUP BY column HAVING COUNT
(*) > 1

This will return the column value and the number of duplicates for that value.

edit | flag
William Patrick
Answered on: Jun 28, 2011 at 1:48AM
45
3
45

Try this Query..

SELECT column,COUNT(*) c FROM table
GROUP BY column HAVING COUNT
(*) > 1

This will return the column value and the number of duplicates for that value.

edit | flag
Gokul A
Answered on: Jun 28, 2011 at 1:49AM

Post your Answer

Search

Welcome to Ask Amoeba!
This is 100% free and interactive site for sharing professional Questions and Answers, Opensource projects, Interview questions.
Learners, beginners, Experts stop and share your knowledge and ideas!

Browse Categories

Browse Tags