0

以下のようなデータがありますが、これは部分的なもので、いくつかの行が欠落しています。以前の利用可能な値を考慮したデータの平均が必要です。SQLでそのような平均に使用できる関数はありますか? 

必要な平均: 220 

10 日間の利用可能なデータ:

1st day: 100
4th day: 200
7th day: 300
10th day: 400

同じものを表形式にすると:

Rows    Date        Partial Continuous(needed)
1       01-Aug-18   100     100     
2                           100
3                           100
4       04-Aug-18   200     200     
5                           200
6                           200
7       07-Aug-18   300     300     
8                           300
9                           300
10      10-Aug-18   400     400     
-----------------------------------
Average             250     220
-----------------------------------

select avg(partial*(nextdate-date))/(lastdate-firstdate) from mytable; のようなものを見ています。

4

2 に答える 2