首页 新闻 搜索 专区 学院

SQL优化?

0
悬赏园豆:10 [已关闭问题] 关闭于 2014-08-11 09:09

能不能去掉下面SQL的子查询,因为要进行视图索引.

SELECT     dbo.CM_Book.BookID, dbo.CM_BookPageDetail.Title, dbo.CM_BookPageDetail.[Content], dbo.CM_BookPageDetail.Memo, dbo.CM_BookPage.PageID, 
                      dbo.CM_BookCategory.CategoryID, dbo.CM_Book.BookName, AuthorInfo.AuthorID, AuthorInfo.AuthorName
FROM         dbo.CM_Book INNER JOIN
                      dbo.CM_BookCategory ON dbo.CM_Book.CategoryID = dbo.CM_BookCategory.CategoryID INNER JOIN
                      dbo.CM_BookPage ON dbo.CM_Book.BookID = dbo.CM_BookPage.BookID INNER JOIN
                      dbo.CM_BookPageDetail ON dbo.CM_BookPage.PageID = dbo.CM_BookPageDetail.BookPageId LEFT OUTER JOIN
                          (SELECT     dbo.CM_BookAuthorRelation.BookID, dbo.CM_BookAuthor.AuthorID, dbo.CM_BookAuthor.AuthorName
                            FROM          dbo.CM_BookAuthorRelation INNER JOIN
                                                   dbo.CM_BookAuthor ON dbo.CM_BookAuthorRelation.AuthorID = dbo.CM_BookAuthor.AuthorID) AS AuthorInfo ON 
                      dbo.CM_Book.BookID = AuthorInfo.BookID
空明流光的主页 空明流光 | 初学一级 | 园豆:69
提问于:2014-08-10 12:56
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册