Advertisement
korenizla

Тема 7 Урок 7 Задача 2

Jan 19th, 2023
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT *,
  2.         SUM(total_amt) OVER (PARTITION BY EXTRACT(MONTH FROM paid_at))
  3. FROM tools_shop.orders;
  4.  
  5. -- ИЛИ
  6.  
  7. SELECT *,
  8.         SUM(total_amt) OVER (PARTITION BY DATE_TRUNC('month', paid_at))
  9. FROM tools_shop.orders;
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement