我在这个声明中的错误是什么?
Select Max (TBLvirtual.c2) as MOF --> Most ordered food (MOF)--//
,TBLvirtual.c1
from
(select a.OrdItems as c1, count(a.OrdID) as c2
from Orderrouter a
group by a.OrdItems) as TBLvirtual
我收到了这个错误:
消息 8120,级别 16,状态 1,第 3 行列“TBLvirtual.c1”在选择列表中无效,因为它不包含在聚合函数或 GROUP BY 子句中。