还是根据前两幅图,得出第三幅图:


通过上面的两幅图,得出下面的这一附图的效果:

谢谢咯!注意是SQL select语句完成的呢。
------解决方案--------------------
select
a.*,isnull(b.amount,0) as paid,
a.amount-isnull(b.amount,0) as balance
from
a left join b on a.InvoiceNo=b.InvoiceNo
select
a.*,isnull(b.amount,0) as paid,
a.amount-isnull(b.amount,0) as balance
from
a left join b on a.InvoiceNo=b.InvoiceNo