合并a.month,a.day,sum(a.pv)/count(a.)报错TOK_ALLCOLREF is not supported in current context:
Select a.month,a.day,sum(a.pv)/count(a.) from (Select month,day, remote_addr,count(1) as pv from ods_weblog_detail group by remote_addr,month,day) as a; {报错:TOK_ALLCOLREF is not supported in current context}
单独分开a.month,a.day和sum(a.pv)/count(a.)都能正确执行:
Select sum(a.pv)/count(a.) from (Select month,day, remote_addr,count() as pv from ods_weblog_detail group by remote_addr,month,day) as a; 可以正确执行
Select a.month,a.day from (Select month,day, remote_addr,count() as pv from ods_weblog_detail group by remote_addr,month,day) as a; 也能正确执行
请问是什么原因呢?怎样解决啊?谢谢了!