摘要:
```code 1、每年
select year(ordertime) 年,
sum(Total) 销售合计
from
订单表
group by year(ordertime)
2、每月
select year(ordertime) 年,
month(ordertime) 月,
sum(Total) 销售合计
from
订单表
group by year(ordertime),
month(or... 阅读全文
摘要:
```code 以出生日期来统计 select nnd as '年龄段',count( ) as '人数' from ( select case when Birthday = DATEADD(yy, DATEDIFF(yy,0,getdate()) 25, 0) then '25岁以下' when 阅读全文