<[EMAIL PROTECTED]> wrote:
> i have a question regarding the handling of the count()
> option in a sql-statement.
> i have the following statement:
> select distinct(ip), count(*) from log group by ip
> This gives me a table with 2 columns and i want to
> it sorted by the count(*) column. How would i do that??
> ...order by count(*) is not an option because it results
> in an error saying that count(*) does not exist.

Try aliasing count(*).

..., count(*) AS count
ORDER BY count

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to