本文介绍了关于sql和vb问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我正在尝试使用简单的银行软件。使用前端作为VB,后端作为ms访问。我有2个表,即newacount和deposit。 newacount包含像accholdername,accnum,ledgeramount和存款表这样的字段,包含字段accnum和depoamount。现在我的问题是,如果我在depoamount字段中存入一些金额,它应该在legderamount字段中更新,我该怎么做呢请帮助我
Hi am trying to do simple bank software. Using front end as VB and back end as ms access. I have 2 table namely "newacount" and "deposit". A newacount contain a fields like accholdername,accnum,ledgeramount, and deposit table contains field accnum and depoamount. Now my question is if I deposit some amount in depoamount field it should update in legderamount field also how can I do that pls help me
推荐答案
UPDATE newacount AS n
SET n.ledgeramount = d.depoamount
INNER JOIN deposit AS d
ON n.accnum = d.accnum
另一种可能性:
Another one possibility:
UPDATE newacount
SET ledgeramount = d.depoamount
FROM ( SELECT accnum,depoamount FROM deposit ) d
WHERE accnum = d.accnum
这篇关于关于sql和vb问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!