[thelist] SQL: Order By Count

Beam sbeam at syxyz.net
Mon Feb 17 11:00:01 CST 2003


> I want it to give me the output in order of highest Count to lowest.  I
> tried putting "ORDER BY Count(*)" both before and after the GROUP BY
> clause, but both gave syntax errors.  Is what I want possible in a
> single query?  The database is MySQL 3.xx, so sub-queries aren't
> allowed.
>

use the AS keyword:
SELECT COUNT(*) AS count_chocula ... ORDER BY count_chocula




More information about the thelist mailing list