------解决方案-------------------- select sum(a.sl) sl from a,b where a.qxbm=b.qxbm;
------解决方案-------------------- SELECT SUM(A.SL) SL FROM A INNER JOIN B ON A.QXBM=B.QXBM
------解决方案-------------------- select sum(nvl(sl,0)) from a where exists (select qxbm from b where b.qxbm=a.qxbm)
------解决方案-------------------- select sum(sl) from A,B where tb1.qxbn=tb2.qxbm
------解决方案--------------------
SQL code
select sum(a.sl) sl
from a,b
where a.qxbm=b.qxbm;
------解决方案--------------------
------解决方案--------------------
SQL code
select sum(nvl(a.sl,0)) as sl_sum
from A a
where exists (select 1 from B b where b.qxbm=a.qxbm)