我有这些桌子
BooksCatalog
[BookCatalogID],[BooksCatalogBookID],[ReceivedFrom],[BillNo],[billdate]
Books
[BookID],[BookTitle],[ISBN],[ISBN13],[BookAuthorID],[BookPublisherID],[YearPublished],[NumberOfPages],[Volume],[edition],[Price]
Authors
[AuthorID],[AuthorName],[AuthorCityID],[AuthorStateID],[PhoneNumber],[Email],[Website]
我正在运行这个查询,
SELECT Books.BookTitle FROM Books
INNER JOIN Authors ON Authors.AuthorId=Books.BookAuthorID
WHERE Books.BookID IN
(SELECT BooksCatalog.BooksCatalogBookID FROM BooksCatalog
WHERE BooksCatalog.billdate = (SELECT MIN(BooksCatalog.billdate) FROM BooksCatalog))
AND
AUTHORS.AuthorName = @AuthorName;
因为它使用了 2 个子查询,所以我感觉它没有优化,如果与等效的内部连接一起使用,它可以表现得更好。那么,这个等效的内部连接是什么?我正在做的是找到添加到库中的第一个给定作者。