我在执行此查询时遇到“查询执行期间超出资源”错误:
SELECT date_time,Atok,Segment,
COUNT(Distinct GoogId) AS DistUsers,
SUM(CASE WHEN EventType=1 THEN 1 ELSE 0 END) AS CntImp,
SUM(CASE WHEN EventType=2 THEN 1 ELSE 0 END) AS CntClick,
SUM(CASE WHEN EventType=3 THEN 1 ELSE 0 END) AS CntVisit,
SUM(CASE WHEN EventType=4 THEN 1 ELSE 0 END) AS CntConv,
FROM LogData.unified_logs
GROUP EACH BY 1,2,3;
有什么想法吗?
答案 0 :(得分:2)
计算不同是罪魁祸首......你应该能够创建一个子查询来执行一个额外的组(每个组)来计算不同的用户。