[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
group by error in query
Hi,
I've just ported from SQLServer where this query ran fine, however MySQL
gives an "invalid use of group function" error.
Any ideas?
thx
dan
select us.username, us.id as userid, count(*) as tips from UserTippingInfo
u, Matches m, Users us WHERE round = 23 AND us.id = u.userid AND
m.matchnumber = u.matchnumber and played = 1 and u.tip = m.winner and
u.competitionid = 20 and datemade < dateplayed group by us.username, us.id
order by count(*) DESC, MIN(datemade) LIMIT 10
UserTippingInfo u Matches m Users us
userid int matchnumber int id int
competitionid into round tinyint username varchar(50)
matchnumber int played tinyint
datemade datetime winner varchar(25)
tip varchar(25) dateplayed datetime
---------------------------------------------------------------------
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 <mysql-thread68951@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.