Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.45 KB | None | 0 0
  1. SELECT install_day,
  2.        SUM(sum_usd)
  3. FROM
  4.   (SELECT attribute_profile_id profile_id,
  5.           MIN(segment_date) AS install_day
  6.    FROM marketing_installs_dist FINAL
  7.    WHERE profile_id <> ''
  8.    GROUP BY profile_id
  9.    HAVING install_day = '2020-03-29') ANY
  10. LEFT JOIN
  11.   (SELECT profile_id,
  12.           SUM(price_usd) AS sum_usd
  13.    FROM purchases_dist
  14.    WHERE DAY >= '2020-03-29'
  15.    GROUP BY profile_id) USING profile_id
  16. GROUP BY install_day
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement