I want to fetch the top 10 most duplicate rows from the following table:
Table Name: votes(id,vote)
--------------------------
1 | Taylor Swift
2 | Maroon5
3 | Maroon5
4 | Maroon5
5 | Taylor Swift
6 | Kanye West
Output Should be something like:
1. Maroon5: 3 votes
2. Taylor Swift: 2 votes
3. Kanye West: 1 votes
How to do that using MySQL only ( if possible )
Thank you
select vote, count(*)
from votes
group by 1
order by 2 desc
limit 10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With