AL-zami AL-zami - 7 months ago 8
SQL Question

syntax error(missing operator) in query in ms access

i have the following relational database tables

enter image description here

to get the author name of a certain book i made the following query


SELECT authors.name

FROM authors

INNER JOIN book_author ON authors.id=book_author.author_id

INNER JOIN books

ON books.id=book_author.book_id WHERE books.id=1;


but it is giving me the error in the title .How i can fix that ?

Answer

Name is not a field in the table "authors". Select authors.author_name and it will run.

SELECT authors.author_name

FROM authors

INNER JOIN book_author ON authors.id=book_author.author_id
WHERE book_author.book_id=1;
Comments