select nvl(a1,0)+nvl(a2,0) as a,nvl(b1,0)+nvl(b2,0) as b from( select (a/x)as a1,(b/x)as b1 from table where id='1' union all select (a/x)as a2,(b/x)as b2 from table where id='2' )
第2个回答 2006-11-20
select sum(a/x) as aa,sum(b/x) as bb from table where id=1 or id=2本回答被提问者采纳