Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Populating Average for a period

User_IC3C9Sep 9 2020 — edited Sep 11 2020

Hi-Need assistance to populate the column avg_days using sql.

For a quarter for a particular Mat_no we need to calculate the avg of dl and the calculated avg dl need to be populated in the column avg_days against the same material in the next quarter.

If the Material number is not present in the previous quarter then populate in the current quarter as null under the column avg_days

    Thanks in advance.

 

mat_nodel_datedlavg_days
M011/2/201915
M011/12/201914
M011/16/201912
M011/19/201912
M012/24/201910
M021/4/20195
M021/11/20197
M021/15/20198
M021/17/20196
M022/25/20198
M031/5/201912
M031/9/201915
M031/14/201911
M031/20/201914
M033/27/20199
M041/8/201914
M041/12/201912
M041/16/201911
M041/21/201910
M042/28/201916
M014/2/20191612.6
M014/12/20191412.6
M014/16/20191212.6
M014/19/20191212.6
M015/24/20191012.6
M024/4/201956.8
M024/11/201976.8
M024/15/201986.8
M024/17/201966.8
M025/25/201996.8
M034/5/20191212.2
M034/9/20191512.2
M034/14/20191112.2
M034/20/20191412.2
M036/27/2019912.2
M054/8/201914
M054/12/201912
M054/16/201911
M054/21/201910
M055/28/201916
M017/2/20191512.8
M017/12/20191412.8
M017/16/20191212.8
M017/19/20191212.8
M018/24/2019812.8
M027/4/201957
M027/11/201977
M027/15/201987
M027/17/201997
M028/25/201987
M047/5/201912
M047/9/201915
M047/14/201911
M047/20/201914
M048/27/201910
M057/8/20191412.6
M057/12/20191212.6
M057/16/20191112.6
M057/21/20191012.6
M058/28/20191612.6
M0110/2/20191512.2
M0110/12/20191412.2
M0110/16/20191212.2
M0110/19/20191212.2
M0111/24/20191012.2
M0210/4/201957.4
M0210/11/201977.4
M0210/15/201987.4
M0210/17/201967.4
M0211/25/201987.4
M0410/5/201912
Comments
Post Details
Added on Sep 9 2020
18 comments
400 views