Suppose I've got a column known as "fruits" I wish to choose all the top fruits, rated by fruits (and group by + count).
Fruits: orange orange apple banana apple apple
Within this situation, the choose statement would return:
apple, 3 orange, 2 banana, 1
SELECT fruit_name, COUNT(fruit_id) FROM fruit GROUP BY fruit_name ORDER BY COUNT(fruit_id) DESC
select fruits, count(fruits) from table group by fruits order by count(fruits) desc
SELECT fruitname, COUNT(*) AS ttl FROM fruits GROUP BY fruitname ORDER BY ttl DESC
select fruits, count(fruits) from fruit group by fruits order by 2 desc