|
-
Mar 30th, 2008, 10:50 AM
#1
Thread Starter
PowerPoster
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?
Last edited by Pino; Mar 30th, 2008 at 11:21 AM.
-
Mar 30th, 2008, 11:24 AM
#2
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 )
-
Mar 30th, 2008, 11:27 AM
#3
Thread Starter
PowerPoster
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
-
Mar 30th, 2008, 11:43 AM
#4
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|