Im having a kind of wish list where people pop in there various wishes. I then list it with the following query
SELECT count(id), name FROM wish GROUP BY name ORDER BY name;
Now i would like to make a top 10, but need a little help with the query.
The problem as i see it is that each wish is on a row by it self in the table:
table:
id pkey, int
name varchar
date date
so i need to figure out how to group the name and the order by the name that get the highest count, initially i tryed
SELECT count(id), name FROM wish GROUP BY name ORDER BY count(id) DESC LIMIT 10;
but ofcause that does not work.