Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    Did you try a window function instead? Commented May 31, 2019 at 11:46
  • @a_horse_with_no_name I tried to wrap my head around them, but it was not bright enough for that today... Commented May 31, 2019 at 20:40
  • Something like: sum(total_price_sum) over (order by created_at_date range between '30 day' preceding and current row) as pp_turnaround_of_last_30_days Commented Jun 1, 2019 at 4:13