Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- LL_entry_date,
- ll_seniority,
- country,
- platform,
- count(distinct user_id) as active_users
- from
- (
- SELECT
- *,
- datediff(day, LL_entry_date, interval_date) ll_seniority
- FROM
- (
- SELECT
- *,
- mode(A1) OVER (partition by user_id) LL_entry_date
- from
- (
- SELECT
- *,
- CASE
- WHEN login_arena <= 22
- and finish_arena >= 23 then interval_date
- else null
- end A1
- FROM
- MATCH_MASTERS.PROD.DAILY_USERS_FROM_PARAMS
- where
- is_active = 1
- )
- )
- )
- where
- LL_ENTRY_DATE is not null
- and LL_seniority >= 0
- group by
- 1,
- 2,
- 3,
- 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement