Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SUM(o.total_amt) / COUNT(DISTINCT o.user_id) ltv,
- DATE_TRUNC('month', u.created_at::TIMESTAMP) create_date
- FROM tools_shop.orders o
- JOIN tools_shop.users u ON o.user_id=u.user_id
- GROUP BY DATE_TRUNC('month', u.created_at::TIMESTAMP)
Add Comment
Please, Sign In to add comment