大概可以如这个吧:
selectc.name,
aaa=sum(case when s.times > 2005-04-20 then spareprice end),
bbb=sum(case when s.times > 2005-04-20 and s.times < 2005-04-20 then sparePrice end)from customer as c inner join services as sonc.id = s.cust_idgroup by c.name
selectc.name,
aaa=sum(case when s.times > 2005-04-20 then spareprice end),
bbb=sum(case when s.times > 2005-04-20 and s.times < 2005-04-20 then sparePrice end)from customer as c inner join services as sonc.id = s.cust_idgroup by c.name
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货