Advertisement
AliaksandrLet

Расчёт средних значений. ARPU и ARPPU Задание 3 из 3

Oct 16th, 2022 (edited)
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     CAST(DATE_TRUNC('year', u.created_at) AS date) AS year,
  3.     ROUND(SUM(o.total_amt) / COUNT(DISTINCT o.user_id), 2) AS arppu
  4. FROM
  5.     tools_shop.orders AS o
  6.     INNER JOIN tools_shop.users AS u ON u.user_id = o.user_id
  7. GROUP BY
  8.     year
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement