как создать stored procedure
как из этого сделать stored procedure
SELECT (Authors.Firstname+' '+ Authors.lastname) as Name, COUNT(books.authorID) as TotalBooks
FROM BookSales2, Authors, Books
where BookSales2.BookId=Books.Id and
Books.AuthorID=Authors.ID
GROUP BY Authors.Firstname, Authors.lastname;
так не работает
CREATE PROCEDURE TotalofBooks
AS
SELECT (Authors.Firstname+' '+ Authors.lastname) as Name, COUNT(books.authorID) as TotalBooks
FROM BookSales2, Authors, Books
where BookSales2.BookId=Books.Id and
Books.AuthorID=Authors.ID
GROUP BY Authors.Firstname, Authors.lastname;
GO;