Siggles Posted July 31, 2008 Share Posted July 31, 2008 Hi I have a query.. SELECT predictions.resultmfc, predictions.resultother, predictions.score, fixtures.opponent, fixtures.resultus, fixtures.resultthem, fixtures.homeaway, predictions.id, predictions.username, DATE_format( fixtures.dateplayed, '%M %e, %Y' ) AS newdate, predictions.predictionid, SUM( predictions.score ) AS Total_Score FROM fixtures RIGHT JOIN predictions ON predictions.id = fixtures.id GROUP BY predictions.username ORDER BY dateplayed, username because I have the GROUPBY clause in there it will only display the predictions from my database for one fixture because it will only show one prediciton per user. If I remove the SUM(predictions.score) and GROUP BY sections fromt he query the page displays correctly but I cannot show users individual score for each preidction. If I change the GROUP BY clause to fixtures.opponent then it shows both fixtures but only one prediction from each. Anyone know what I can do here to rememdy this? Quote Link to comment Share on other sites More sharing options...
Siggles Posted July 31, 2008 Author Share Posted July 31, 2008 Sorry sorted it, didn't even need SUM in there, so I removed the GROUP BY. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.