1
select tblProductMaster.*,AVG(tblReviewMaster.Rating) from tblProductMaster
left join tblReviewMaster
on tblProductMaster.ProductID = tblReviewMaster.ProductID
Group By tblProductMaster.ProductID
該查詢返回錯誤:在SQL Server 2008
Column 'tblReviewMaster.ReviewID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
這不是讓我有AVG功能的任一列...如果我寫
select AVG(tblReviewMaster.Rating) from tblProductMaster ...
然後它工作正常
那麼如何從tblProductMaster
獲得產品詳細信息?
感謝答覆,它工作正常..ü救了我太多的時間.. :) –
@shivanipatel:這是我們推薦#2接受的答案,如果它是有用的並且是您的問題的最佳答案。這有助於其他人尋找解決方案。 –
對不起,我是新來的stakoverflow,所以我知道它.. –