Forum Moderators: coopster
CREATE TABLE `ratings` (
`rid` int(255) NOT NULL auto_increment,
`uid` varchar(255) NOT NULL default '',
`sid` varchar(255) NOT NULL default '',
`rating` enum('1','2','3','4','5') NOT NULL default '1',
`date` varchar(255) NOT NULL default '',
PRIMARY KEY (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=403 ;
I want to take and group all the sid's and group them together and then display them out based on the average of the rating.
Something like this:
SELECT * FROM ratings GROUP BY sid ORDER BY AVG(rating)
That doesn't work and I'm not quite sure how to make it work. If anyone can help it would be greatly appreciated!