Hey there! any question in your mind? Ask It Now!.

Popular Categories

print duplicate entry from a table with their count

+12 votes
asked in Programming by Himanshu Expert (5,940 points)
How to print duplicate entry from a table with their count? my table has junk data and want to see the duplicates values, can you tell me the exact query for the same?

1 Answer

+4 votes
answered by Eathen (1,930 points)
selected by Himanshu
Best answer

For print duplicate entry from a table with their count see this query ->

select * FROM


FROM USER_TABLE)  duplicates
WHERE duplicates.Cnt > 1
NOTE: Here  fname is column name and USER_TABLE is table in which you want to find duplicate entries.
commented by Himanshu Expert (5,940 points)
yah thanks dear.
commented by nitu (1,680 points)
Nice work @Eathen it helped me also.
commented by Pankaj
Or you might use this query :

mysql>  select COLUMN_NAME_HERE, count(*) as c from TABLE_NAME_HERE group by COLUMN_NAME_HERE;

Related Questions

+8 votes
1 answer 120 views
+8 votes
2 answers 132 views
+6 votes
1 answer 148 views
+2 votes
1 answer 120 views
+1 vote
0 answers 117 views
+2 votes
1 answer 877 views
+1 vote
1 answer 1,070 views
+7 votes
7 answers 1,501 views
0 votes
0 answers 466 views

Not a Member yet?

Ask to Folks Login

My Account
444 Folks are online
2 members and 442 guest online
Your feedback is highly appreciated