katie77 Posted November 28, 2007 Share Posted November 28, 2007 Hi there, The code below is not working, and I wondered if anyone could tell me why? Does it matter that I'm using the occupation column in the WHERE statement without selecting it? Occupation is in the original table. select software_name, software_img, software_company, software_platforms, cost_pound, cost_dollar, cost_euro, avg(rating_modelling) as rating_modelling, avg(rating_texturing) as rating_texturing, avg(rating_rendering) as rating_rendering, avg(rating_animating) as rating_animating, avg(rating_stability) as rating_stability, avg(rating_speed) as rating_speed, avg(rating_support) as rating_support, avg(rating_value) as rating_value, avg(rating_overall) as rating_overall, sum(total_votes) as total_votes from software WHERE occupation = 'student' ORDER BY rating_overall DESC GROUP BY software_name, software_img, software_company, software_platforms, cost_pound, cost_dollar, cost_euro; Many thanks, Katie Quote Link to comment https://forums.phpfreaks.com/topic/79285-solved-group-by-order-by-average-and-sum/ Share on other sites More sharing options...
fenway Posted November 28, 2007 Share Posted November 28, 2007 What do you think it's going to do... because with that many group by fields, it's not going to do it. Quote Link to comment https://forums.phpfreaks.com/topic/79285-solved-group-by-order-by-average-and-sum/#findComment-401365 Share on other sites More sharing options...
katie77 Posted November 28, 2007 Author Share Posted November 28, 2007 Hi there, thanks for your reply. The code seems to work how I want it now that I have taken the where statement out. Quote Link to comment https://forums.phpfreaks.com/topic/79285-solved-group-by-order-by-average-and-sum/#findComment-401398 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.