Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- CAST(DATE_TRUNC('year', u.created_at) AS date) AS year,
- ROUND(SUM(o.total_amt) / COUNT(DISTINCT o.user_id), 2) AS arppu
- FROM
- tools_shop.orders AS o
- INNER JOIN tools_shop.users AS u ON u.user_id = o.user_id
- GROUP BY
- year
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement