Sql Error Msg 8120

Jan 20 2011 12:31 AM
Hi,

I am getting erorr sql stored procedure

Code

Select ProductID,ProductName,ProductCategoryName,Sum(UnitsInStock),ProductImageID,SUBSTRING(Description,1,150) + '...' As Description,Price,DeliveryDate from Products INNER JOIN ProductCategory  ON ProductCategory.ProductCategoryID = Products.ProductCategoryID

Error Message

Msg 8120, Level 16, State 1, Line 1
Column 'Products.ProductID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

How to fix this ?



Answers (2)