我想制定一个程序,帮助我查找作者的所有书籍。 我现在得到的代码仅列出了所有书籍及其作者的清单。
我需要更改什么?
DELIMITER $$
CREATE PROCEDURE BookByAuthor(
BookName VARCHAR(50),
AuthorName VARCHAR(50)
)
BEGIN
SELECT distinct
Books.Book_Name,
Books.BookID,
CONCAT(Author_FirstName,' ',Author_LastName) AS Author
FROM Authors
INNER JOIN Author_Book
ON Author_Book.AuthorID = Authors.AuthorID
INNER JOIN Books
ON Author_Book.BookID = Books.BookID;
END$$
DELIMITER ;