Advertisement
kirzecy670

Untitled

Jun 18th, 2025 (edited)
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WITH
  2. watch_device as
  3.   (SELECT userId
  4.    FROM wimc.mp_userDevice
  5.    WHERE deviceType = 'watch'
  6.      AND ts >= '2025-06-01'),
  7.  
  8. user_setting AS
  9.   (SELECT DISTINCT user_id::UInt64 AS user_id
  10.    FROM stat.user_setting_history
  11.    WHERE ts >= '2025-06-10'
  12.      AND name = 'circles_concept_enabled'
  13.      AND value IN (1, '1', '"1"'))
  14.  
  15. SELECT toDate(ts) as date,
  16.        count(parent) as users,
  17.        uniqExact(parent) as uniqUesers
  18. from wimc.mp_parentChild pc
  19. join watch_device wd on pc.child = wd.userId
  20. join user_setting us on us.user_id = pc.parent
  21. where ts >= '2025-06-01'
  22. GROUP BY 1
  23. ORDER BY 1 DESC
  24. limit 100;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement