要分两步?一句sql语句能实现吗?[/quote]
能,但很麻烦,这样?
(select 类别,sum(数量) as Total from aTable group by 类别 where 类别<>'c') union (select 类别,数量 as total from aTable where 类别='c')[/quote]
对的,就是这样,我试了下已经可以了,nice啊
要分两步?一句sql语句能实现吗?[/quote]
能,但很麻烦,这样?
(select 类别,sum(数量) as Total from aTable group by 类别 where 类别<>'c') union (select 类别,数量 as total from aTable where 类别='c')