pureDesi Posted April 27, 2007 Share Posted April 27, 2007 I'm new to MySQL and couldn't figure this out for the life of me, I'm trying to pull out stats for a game from another table with a restriction, see below. SELECT gameID, gameTitle, gameUnique, COUNT(mapID) FROM games, maps WHERE gameEnabled=1 AND mapParentID = gameID ORDER BY gamePriority DESC, gameTitle ASC It's intention is to pull all the games out (if it's enabled) and count how many maps are in each game from a separate table, "maps". I'm completely lost as to how I would use GROUP BY. Any help would be appreciated Thanks for your time -pure Link to comment https://forums.phpfreaks.com/topic/49001-solved-how-to-get-specific-stats/ Share on other sites More sharing options...
bubblegum.anarchy Posted April 27, 2007 Share Posted April 27, 2007 The GROUP BY value is what identifies each unique group of records - maybe mapParentID Link to comment https://forums.phpfreaks.com/topic/49001-solved-how-to-get-specific-stats/#findComment-240096 Share on other sites More sharing options...
pureDesi Posted April 28, 2007 Author Share Posted April 28, 2007 Ah! I appreciate the help, and it now works! Link to comment https://forums.phpfreaks.com/topic/49001-solved-how-to-get-specific-stats/#findComment-240175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.