Jump to content

[SOLVED] ORDER BY and GROUP BY


awebbdesign

Recommended Posts

Just a mysql question...

I am trying to sort by a column having a group in it....

 

SELECT sum(2007_playersresults.score) AS thescore, 2007_playerslist.playerfirstname, 2007_playerslist.playersurname

FROM 2007_playersresults

LEFT JOIN 2007_playerslist

ON 2007_playerslist.playernumber = 2007_playersresults.playernumber

GROUP BY 2007_playersresults.playernumber

 

The above works fine...

 

http://www.oxfordauntsally.co.uk/stats_players_all.php?year=2007

 

But when I add...

 

SELECT sum(2007_playersresults.score) AS thescore, 2007_playerslist.playerfirstname, 2007_playerslist.playersurname

FROM 2007_playersresults

LEFT JOIN 2007_playerslist

ON 2007_playerslist.playernumber = 2007_playersresults.playernumber

GROUP BY 2007_playersresults.playernumber

ORDER BY 2007_playersresults.score

 

The whole thing crashes!

Anybody out there how can help?

 

Link to comment
https://forums.phpfreaks.com/topic/51862-solved-order-by-and-group-by/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.