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

Databases

I'm having an issue with this query. Can someone please help me?

SELECT * FROM Media JOIN Genres on Media.media_id = Media_Genres.media_id LEFT OUTER JOIN Genres ON Media_Genres.genre_id = Genres.genre_id WHERE media_id=3;

1 Answer

Steven Parker
Steven Parker
229,952 Points

Without a link to the course video/quiz/challenge or a description of what the issue is, this is a bit of a guess.

:point_right: But one thing stands out in the query itself:

SELECT * FROM Media
JOIN Genres              -- Did you intend to write "JOIN Media_Genres" here?  
  on Media.media_id = Media_Genres.media_id
LEFT OUTER JOIN Genres ON Media_Genres.genre_id = Genres.genre_id
WHERE media_id=3;