0
我目前正在嘗試計算谷歌大查詢行之間的時間戳差異附加是我用來測試代碼的示例表。谷歌大查詢行之間的時間差異
我使用此代碼
SELECT
A.row,
A.issue.updated_at,
(B.issue.updated_at - A.issue.updated_at) AS timedifference
FROM [icxmedia-servers:icx_metrics.gh_zh_data_production] A
INNER JOIN [icxmedia-servers:icx_metrics.gh_zh_data_production] B
ON B.row = (A.row + 1)
WHERE issue.number==6 and issue.name=="archer"
ORDER BY A.requestid ASC
從這個問題Calculate the time difference between of two rows
我盡力去做等於你的sugestion - AS爲TimeDifference LAG(issue.updated_at)OVER(ORDER BY issue.updated_at) - - issue.updated_at在我的查詢,但是我收到一個錯誤 - 缺少函數在分析表達中的應用。你有沒有正確的可能性? –
請用你想要實現的例子創建一個單獨的問題。 –
我試圖獲得行之間的差異,但值是整數,而不是時間戳。 LAG功能獨自運作良好。但是如果我嘗試做減法,你建議我收到警告 - 分析表達式中的缺失函數。是不同的列和值的同一個問題。 –