1

I am trying to add a calculated column that computes a rolling average of a sorted partition. I can make it work as a query but cannot seem to get the result to become a calculated field.

ALTER TABLE PUBLIC "minutes" 
    ADD COLUMN "green_avg" NUMERIC (10,2) 
    AS GENERATED AVG("price") OVER(PARTITION BY "key"
    ORDER BY "endtime" ROWS BETWEEN 30 PRECEDING AND CURRENT ROW)
Uwe Allner
  • 3,399
  • 9
  • 35
  • 49
Nuljon
  • 11
  • 1

0 Answers0