jck Posted July 15, 2007 Share Posted July 15, 2007 SELECT ItemID, avg(rating) as mr from dd_rating WHERE mr <= $Item_Rating group by ItemID ORDER by mr DESC LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/60071-what-is-wrong-with-this-query/ Share on other sites More sharing options...
ToonMariner Posted July 15, 2007 Share Posted July 15, 2007 If it doesn't work then yes... try SELECT ItemID, avg(rating) from dd_rating WHERE rating <= $Item_Rating group by ItemID ORDER by rating DESC LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/60071-what-is-wrong-with-this-query/#findComment-298776 Share on other sites More sharing options...
jck Posted July 15, 2007 Author Share Posted July 15, 2007 i think ur query takes to one with highest sum of votes.... if i am correct i need it to go to one with next highest avg votes Link to comment https://forums.phpfreaks.com/topic/60071-what-is-wrong-with-this-query/#findComment-298782 Share on other sites More sharing options...
ToonMariner Posted July 15, 2007 Share Posted July 15, 2007 try LIMIT 1,1 then Link to comment https://forums.phpfreaks.com/topic/60071-what-is-wrong-with-this-query/#findComment-299002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.