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 242 views
+8 votes
2 answers 221 views
+2 votes
1 answer 203 views
+2 votes
1 answer 1,080 views
+1 vote
1 answer 1,393 views

Not a Member yet?

Ask to Folks Login

My Account
254 Folks are online
0 members and 254 guest online
Your feedback is highly appreciated