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 trialJan Svensson
10,005 PointsGenres.genre_id does not exist?
When I'm running this it doesn't pass and I can't figure out why :/
SELECT * FROM Media JOIN Media_Genres ON Media.media_id = Genres.genre_id WHERE Media.media_id=3;
SQL Error: no such column: Genres.genre_id
I can see genre_id if I try to select it though.
1 Answer
Diar Selimi
1,341 PointsSELECT * FROM Media JOIN Genres ON Media.media_id = Genres.genre_id WHERE Media.media_id=3;
You need to tell ON
in which table is the relation so that it can join it, right now you are referring to each self table.
Media.gendre_id = Media.media_id
maybe it would be appropriate !