MS Access中的SQL更新语句 [英] SQL Update Statement in MS Access
本文介绍了MS Access中的SQL更新语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
试图使该查询在MS Access中工作.
Trying to get this query to work in MS Access.
Update Network.Location=Enclave.Location Where Enclave.Site=No AND
Network.AlternateLocation=Enclave.Location Where Enclave.Site=Yes
如果安全区站点字段为否",如果不确定,则将其保存在网络位置中,如果不确定,如何将其正确地存储在网络位置中,这意味着它将存储空白值在该行的网络位置中.
I'm not sure how to get this to do exactly what I want which is store Enclave location in network location if the enclave site field is No and if yes store encalve location in alternate location, meaning it would store a blank value in network location in that row.
关键字段更新:
Update Network InnerJoin Enclave On Network.ID=Enclave.ID Set
Network.Location=Enclave.Location Where Enclave.Site=No AND
Network.AlternateLocation=Enclave.Location Where Enclave.Site=Yes
推荐答案
UPDATE Network Inner Join Enclave ON Network.ID=Enclave.ID
SET Network.Location = IIF(Enclave.Site=False, Enclave.Location, ""),
Network.AlternateLocation = IIF(Enclave.Site=True, Enclave.Location, "")
注意:我还没有尝试过&猜猜,这应该可行.
另外,我假设如果不满足条件,您将希望将该字段更新为空白.
Note: I haven't tried this & guess, this should work.
Also, I have assumed that you will want the field to be updated with blank, if it doesn't satisfy the condition.
这篇关于MS Access中的SQL更新语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文