Skip to content

Instantly share code, notes, and snippets.

@aoxu
Created November 15, 2018 06:53
Show Gist options
  • Save aoxu/a7e8ce1714dc7a179b5d08b3a24d926f to your computer and use it in GitHub Desktop.
Save aoxu/a7e8ce1714dc7a179b5d08b3a24d926f to your computer and use it in GitHub Desktop.
[查询所有用户的最高矿层进度]BigQuery #BigQuery
SELECT
user_id,
max(event_params.value.int_value) /* 只要已解锁的最大矿层数 */
FROM
`analytics_168921341.events_*` AS T,
T.event_params
WHERE
event_name = 'activate_manto'
AND event_params.key = 'manto_id'
AND _TABLE_SUFFIX BETWEEN '20181108' AND '20181109'
GROUP BY user_id /* 按用户id去重,每个id只保留最大矿层进度数 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment