使用外连接select a.a_id,a.a_nm,(select NVL(sum(b.amt),0) from b where a.a_id=b.a_id(+)) 
from a