[thelist] mysql count question - solved
Dunstan Orchard
dunstan at 1976design.com
Sat Mar 22 06:22:32 CST 2003
Hey guys,
thanks for the replies,
> select citename,count(*)
> from newscite
> group by citename
> order by count(*) desc
>
> rudy
> select Name, Count(Name) from tblNames
> group by Name
> order by Count(Name) DESC
>
> Anthony Baratta
oddly enough, neither of these two solutions worked (both gave errors), but
when I tried this:
SELECT name, COUNT(name) as count FROM newscite
GROUP BY name
ORDER BY count DESC
it did work... which is very odd because I would swear I tried this to start
with. It was the failure of this to work that made me go off and try that
whole inner join thing.
Ah well, thankyou for pointing me back in the right direction, it's all
working now.
Cheers - dunstan
---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/
More information about the thelist
mailing list