Invalid Use Of Group Function
Can anyone offer a solution?
Code:
SQL query: Documentation
SELECT tblscorerel.scoreid, tblscores.id, sum( tblscores.score )
FROM tblscorerel
INNER JOIN tblscores ON tblscorerel.scoreid = tblscores.id
ORDER BY sum( tblscores.score )
MySQL said: Documentation
#1111 - Invalid use of group function
Side note, this works in MySql 5. But my host will not upgrade my client to version 5 so I'm stuck on 4. Can anyone offer a work around?
Re: Invalid Use Of Group Function
Add this missing GROUP BY statement
Code:
SELECT tblscorerel.scoreid, tblscores.id, sum( tblscores.score )
FROM tblscorerel
INNER JOIN tblscores ON tblscorerel.scoreid = tblscores.id
Group by tblscorerel.scoreid, tblscores.id
ORDER BY sum( tblscores.score )
Re: Invalid Use Of Group Function
:( Still getting the same error..
Code:
SQL query: Documentation
SELECT tblscorerel.scoreid, tblscores.id, sum( tblscores.score )
FROM tblscorerel
INNER JOIN tblscores ON tblscorerel.scoreid = tblscores.id
GROUP BY tblscorerel.scoreid, tblscores.id
ORDER BY sum( tblscores.score )
LIMIT 0 , 30
MySQL said: Documentation
#1111 - Invalid use of group function
Re: Invalid Use Of Group Function
Remove the ORDER BY - does it work now?
If it does then try adding
ORDER BY 3
and see if that works.
I'm not familiar with MySQL - so that's about as far as my help can go!