i have the following relational database tables
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 ?
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;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.