2
Answers

Sql Error Msg 8120

Prashant  Nair

Prashant Nair

13y
5.5k
1
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)