mrpatg mrpatg - 1 year ago 98
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 Source
SELECT col, count(*)
    FROM tablethingie
    GROUP BY col
    ORDER BY count(*) DESC
    LIMIT 10
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download