Hi,
On Fri, Apr 20, 2001 at 03:01:25PM +0200, [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.
>
That should work in 3.23.xx. If you use 3.22.x then try this:
select distinct(ip), count(*) as cnt from log group by ip order by cnt
Regards,
Fred.
--
Fred van Engen XO Communications B.V.
email: [EMAIL PROTECTED] Televisieweg 2
tel: +31 36 5462400 1322 AC Almere
fax: +31 36 5462424 The Netherlands
---------------------------------------------------------------------
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