2
我使用Google Big Query來查找每天點擊次數。這裏是我的查詢,Google Big Query中的每日點擊次數
SELECT COUNT(*) AS Key,
DATE(EventDateUtc) AS Value
FROM [myDataSet.myTable]
WHERE .....
GROUP BY Value
ORDER BY Value DESC
LIMIT 1000;
這是工作正常,但它忽略了與0人次日期。我想包括這個。我無法在Google Big Query中創建臨時表。如何解決這個問題。
測試得到錯誤Field 'day' not found.
SELECT COUNT(*) AS Key,
DATE(t.day) AS Value from (
select date(date_add(day, i, "DAY")) day
from (select '2015-05-01 00:00' day) a
cross join
(select
position(
split(
rpad('', datediff(CURRENT_TIMESTAMP(),'2015-05-01 00:00')*2, 'a,'))) i
from (select NULL)) b
) d
left join [sample_data.requests] t on d.day = t.day
GROUP BY Value
ORDER BY Value DESC
LIMIT 1000;
問題是如何? – user960567
@ user960567查看我的更新回答 – Pentium10
我只需要一個查詢。 – user960567