oracle查询前十二个月的记录
有如下一张表:
表 A :
(int) (int)
sale year month 每个月都有大量数据,我需要的是每个月的平均销量 sale
100 2017 9
102 2017 9
104 2017 9
210 2017 8
220 2017 8
230 2017 8
.... .... .....
277 2016 1
我现在想要得到距这个月 前十二个月的平均数据:
(int) (int)
sale year month
102 2017 9
220 2017 8
.... .... .....
277 2016 9
求大佬指点!
表 A :
(int) (int)
sale year month 每个月都有大量数据,我需要的是每个月的平均销量 sale
100 2017 9
102 2017 9
104 2017 9
210 2017 8
220 2017 8
230 2017 8
.... .... .....
277 2016 1
我现在想要得到距这个月 前十二个月的平均数据:
(int) (int)
sale year month
102 2017 9
220 2017 8
.... .... .....
277 2016 9
求大佬指点!
...全文


