过程-查找作者X

时间:2018-09-30 18:39:17

标签: mysql select stored-procedures

我想制定一个程序,帮助我查找作者的所有书籍。 我现在得到的代码仅列出了所有书籍及其作者的清单。

我需要更改什么?

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 ;

0 个答案:

没有答案