MySQL errors in Dashboard
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Chameleon (inactive) |
Fix Released
|
Medium
|
JW |
Bug Description
In Admin::
@most_
:order => "COUNT(author) DESC", :conditions => "approved = 1"})
this executes the SQL:
SELECT author, website FROM comments WHERE (approved = 1) ORDER BY COUNT(author) DESC LIMIT 1
which returns the error:
Invalid use of group function
This happens because we're using an aggregate function (COUNT) in the ORDER BY clause.
More info about this message is, amongst others, at http://
An example of this bug is on http://
Changed in chameleon: | |
milestone: | 0.6.2 → 0.6.1.2 |
Changed in chameleon: | |
milestone: | 0.6.1.2 → 0.6.2 |
Changed in chameleon: | |
status: | Fix Committed → Fix Released |
A possible solution is the query
SELECT author, website, COUNT(author) FROM comments WHERE approved = 1
GROUP BY author ORDER BY COUNT(author) DESC LIMIT 1