Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- circle_id,
- user_id,
- user_role,
- created_ts AS join_ts,
- argMin(user_id, created_ts) OVER (PARTITION BY circle_id) AS creator_id,
- min(created_ts) OVER (PARTITION BY circle_id) AS create_ts,
- count(*) OVER (PARTITION BY circle_id ORDER BY created_ts) AS __n_members,
- countIf(user_role = 'Adult') OVER (PARTITION BY circle_id ORDER BY created_ts) AS adult_order
- FROM circles.circle_member
- WHERE toDate(created_ts) >= '2025-06-16'
- and circle_id = 4712007
- order by circle_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement