I have two tables, genre and genre_apps
Genre has the following fields:
export_date genre_id parent_id name
genre_apps has the following fields:
export_date genre_id application_id is_primary
What I would like to do is show all the unique names within genre_apps.
I have tried this
SELECT genre.name from grenre inner_join genre_Apps on (genre.genre.id = genre_apps.genre.id);
but I get an error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'genre_Apps on ( genre . genre . id 开发者_开发知识库= genre_apps . genre . id ) LIMIT 0, 30' at line 1
you need to change
genre.genre.id
to
genre.genre_id
(note the period is replaced with an underscore)
likewise with genre_apps.genre.id. also you refer to table "grenre" which should be "genre" also "inner_join" should be "inner join". try this:
SELECT genre.name from genre inner join genre_apps on genre.genre_id = genre_apps.genre.id;
精彩评论