我有这样的SQL线错误在SQL SUM()
SELECT No_, sum(Quantity) AS Sold, [Shipment Date] AS SoldDate, [Item Category Code],
Description, [Description 2] FROM dbo.[3S Company A_S$Sales Invoice Line]
WHERE [Item Category Code] = '5104' GROUP BY No_
但我得到这个错误我的脚本。
Column 'dbo.3S Company A_S$Sales Invoice Line.Shipment Date' is invalid in the select
list because it is not contained in either an aggregate function or the GROUP BY clause.
任何人都可以帮我解释为什么吗?
假设你有2列在表中数据如下:NO_ = 1,数量= 10和20,装运日期= 20140415和20140414,项目类别代码= 3,说明=“bla”,说明2 = Bla2,你希望你的查询返回为销售日期? – StephaneM