mrpatg mrpatg - 3 months ago 30
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?

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