![]() |
#2
volte2013-12-04 13:33
|
select MAX(dd) from (select AP,AVG(data) as 'dd',lb from test group by AP,lb) temp group by LB
这句话可以通过,但是当变一下
select ap,MAX(dd) from (select AP,AVG(data) as 'dd',lb from test group by AP,lb) temp group by LB
然后就出错了,
消息 8120,级别 16,状态 1,第 1 行
选择列表中的列 'temp.AP' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中
这是为什么?
[ 本帖最后由 咖啡色裂变 于 2013-12-2 17:41 编辑 ]