AL-zami
AL-zami

Reputation: 9066

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 ?

Upvotes: 0

Views: 55

Answers (1)

Berra2k
Berra2k

Reputation: 328

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;

Upvotes: 1

Related Questions