第四题-图表.cpt
用组合图
select strftime('%Y-%m',订购日期) as 日期,strftime('%Y',订购日期) as 年份,count(订单.订单ID) as 订单数量,sum(case when 是否已付="true" then 1 else 0 end) as 已付订单数量, sum(单价*数量) as 月销量
from 订单 join 订单明细 on 订单.订单ID=订单明细.订单ID
where 1=1 ${if(len(年份) == 0,"","and strftime('%Y',订购日期) = '" + 年份 + "'")}
group by 2,1
order by 1