Advertisement
kirzecy670

Untitled

Oct 7th, 2024 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.72 KB | None | 0 0
  1. WITH
  2. pp as (select full_reg_datetime, uid from analytics.parent_properties where full_reg_datetime >= '2024-10-01'),
  3. users AS (
  4. SELECT dt,
  5.         uid,
  6.         IF(visitParamExtractString(addJson, 'option') = 'new', 'New', 'Old') AS groups,
  7.         CASE
  8.               WHEN (deviceType = 2 AND appVersion % 2 = 0) THEN 'iOS'
  9.               WHEN (deviceType = 1 AND appVersion % 2 = 1) THEN 'Android'
  10.         ELSE 'Unknown'
  11.         END AS platform, action
  12. FROM stat.funnelTrack
  13. join pp using(uid)
  14. WHERE
  15. (
  16. (action = 'pteam_notification_setting_in_menu_newuser' and full_reg_datetime = dt_exp_distr_event)
  17. OR
  18. action = 'pteam_notification_setting_in_menu_olduser' and full_reg_datetime < '2024-10-01' - interval '120 day')
  19. ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement