参考。。。
select
sum(销售金额) as 11天销量,
0 as 今年销售,
0 as 月销量
from 销售表
where 1=1
and mydate >='${DATEDELTA(时间参数,-11)}'
and mydate <='${时间参数}'
union all
select
0 as 11天销量,
sum(销售金额) as 今年销售,
0 as 月销量
from 销售表
where 1=1
and mydate >='${ DATEINYEAR(时间参数,1)}'
and mydate <='${时间参数}'
union all
select
0 as 11天销量,
0 as 今年销售,
sum(销售金额) as 月销售
from 销售表
where 1=1
and mydate >='${DATEINMONTH(时间参数,1)}'
and mydate <='${时间参数}'
