日期:2014-05-17 浏览次数:20553 次
select name ,subname,price,sum(amount) amount
from
(
select name,subname,price,0 as amount
from 表
where amount is null
union all
select name,subname,price, amount
from 表
where amount is not null
)
group by name ,subname,price