Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *,
- SUM(total_amt) OVER (PARTITION BY EXTRACT(MONTH FROM paid_at))
- FROM tools_shop.orders;
- -- ИЛИ
- SELECT *,
- SUM(total_amt) OVER (PARTITION BY DATE_TRUNC('month', paid_at))
- FROM tools_shop.orders;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement