Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Group, Joining and cleaning up Challenge 2 of 3

Here is the challenge:

Like before, group reviews by "movie_id", get the average "score" as "average" and filter out any averages over 2.

And here's my solution:

SELECT AVG(score) AS average FROM reviews GROUP BY movie_id HAVING average > 2;

I believe I did it right but I'm still getting an error. Am I missing something here? help

10 Answers

errrhh..Fixed it, got confused by the 'filter out', it meant print out the average UNDER 2.

SELECT AVG(score) AS average FROM reviews GROUP BY movie_id HAVING average < 2;

2 months later and I made the same mistake :p

thanks for the answer

I did the same!

Took me a while to realize I was making this simple mistake. For anyone stuck, pay attention to your sign at the end.

So glad I'm not alone!

haha right there with you guys!

Spent 15 minutes to figure this out!

Ousama Berrag
Ousama Berrag
24,109 Points

I made the same mistake 1 year later

Almost a YEAR later and I made the same mistake as most people here! haha