MySQL根据季度进行统计,并且签名季度数据数据累加到后面

单表计算 根据下单日期(orderTime),计算季度 ,共四个季度。


问题是,季度的数据进行累加怎样实现。例如:

1-3月 是第1季度

3-6月 是第2季度 

以此类推……

现在的问题是。按季度统计数据 如下

第一季度:1-3 月

第二季度:1-6 月

第四季度:1-9 月

sum(case when ordertime>'当年1月1日参数' and ordertime<='20210331' then ? 

         when ordertime>'当年1月1日参数' and ordertime<='20210630' then ? 

        when ordertime>'当年1月1日参数' and ordertime<='20210930' then ? 

        when ordertime>'当年1月1日参数' and ordertime<='20211231' then ? end)