select year(ShippedDate) as 年份, sum ( case when month(ShippedDate) in (1,2,3)) then count(accid) as 销售总份数,sum(account) as 销售总金额 else 0 ) as 第一季度 from EM where ShippedDate like'2010?' group by year(ShippedDate) order by year(ShippedDate)大侠帮忙看看,我这么写有问题吗?
select year(ShippedDate) as 年份,
sum
(
case when
month(ShippedDate) in (1,2,3))
then count(accid) as 销售总份数,sum(account) as 销售总金额
else 0
) as 第一季度
from EM where ShippedDate like'2010?'
group by year(ShippedDate)
order by year(ShippedDate)大侠帮忙看看,我这么写有问题吗?