Advertisement
kirzecy670

Untitled

Apr 10th, 2025 (edited)
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.45 KB | None | 0 0
  1. WITH parents AS
  2.   (SELECT uid,
  3.           region,
  4.           full_reg_datetime::date as full_reg_datetime
  5.    FROM analytics.parent_properties
  6.    WHERE full_reg_datetime >= '2025-03-28'
  7.      AND full_reg_datetime < today() - interval '2' DAY),
  8.      actions AS
  9.   (SELECT uid,
  10.           full_reg_datetime,
  11.           count(dt) >= 2 AS flg_2_or_more
  12.    FROM analytics.parent_actions
  13.    JOIN parents USING uid
  14.    GROUP BY 1, 2)
  15. SELECT * FROM actions;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement