27,579
社区成员
发帖
与我相关
我的任务
分享
--这样?
select A,sum(BB) BB,sum(CC) CC from
(
select A,BB,CC,DD,FF from tbname where DD =1 and FF = 1
union all
select A,BB,CC,DD,FF from tbname where DD = 2 and FF = 1
) T
--这样?
select sum(bb),sum(cc) from t where dd in(1,2) and ff=1
select * from t where dd in(1,2) and ff=1