select * from uTable
order by month(datefiled) % 4
select month(datefiled) % 4 as theM, sum(f1) from uTable
group by month(datefiled) % 4

解决方案 »

  1.   

    select datepart(quarter,时间字段) from 表 group by datepart(quarter,时间字段)
      

  2.   

    试试看,没实践过select sum(f) from table 
        group by (case when month(f_date)<4 then 1 end
                  case when (month(f_date)>3 and month(f_date)<7) then 2 end
                  case when (month(f_date)>7 and month(f_date)>10) then 3 end         
                  case when month(f_date)>9 then 4 end)