这是我当前的查询:
SELECT
item_id,
date,
(avg * stddev(value) over(partition by item_id order by to_date(date,'yyyymm')
RANGE BETWEEN INTERVAL '11' MONTH PRECEDING AND CURRENT ROW)
+
price * stddev(value2) OVER(PARTITION BY item_id ORDER BY to_date(date,'yyyymm')
RANGE BETWEEN INTERVAL '11' MONTH PRECEDING AND CURRENT ROW)
) as a
from table1
有没有办法复制RANGE BETWEEN
SQL Server 中的功能?介于当前月份和前 11 个月之间。