I have events table, now I want to display the most frequent element in a column using SQL
Here is the event table.
id | selectedcountries
0 | Tanzania
1 | Tanzania
2 | Tanzania
3 | Kenya
4 | Uganda
5 | Uganda
6 | Kenya
7 | Uganda
8 | Tanzania
8 | Poland
9 | Poland
10 | Tanzania
UPDATE
For example, for this table it should return Tanzania since it is the most frequent value:
Here is my solution
SELECT selectedcountries, COUNT( 'selectedcountries' ) AS 'country'
FROM EVENTS
GROUP BY 'selectedcountries'
ORDER BY 'country' DESC
Unfortunately, I am getting the following
selectedcountries country
73
What do I need to do to get what I want?
