mrpatg mrpatg - 1 month ago 12
MySQL Question

count top 10 most occuring values in a column in mysql

I have a column in mysql table that has the the data type INT(11).

How can I search to get the top 10 most occurring values in this column?

Answer
SELECT col, count(*)
    FROM tablethingie
    GROUP BY col
    ORDER BY count(*) DESC
    LIMIT 10