update t2004 set t2004.street = tax_jb.scjxdm
from t2004,tax_jb where t2004.nsrmc = tax_jb.nsrmc我需要更新t2004表中的street字段,把它替换成tax_jb里的scjxdm 这个字段
用nsrmc来对应 这样写有什么问题?
PLSQL Developer说我sql命令没正确结束。
from t2004,tax_jb where t2004.nsrmc = tax_jb.nsrmc我需要更新t2004表中的street字段,把它替换成tax_jb里的scjxdm 这个字段
用nsrmc来对应 这样写有什么问题?
PLSQL Developer说我sql命令没正确结束。
t2004
set t2004.street =
(select tax_jb.scjxdm from t2004,tax_jb where t2004.nsrmc = tax_jb.nsrmc )
update t2004 set t2004.street = tax_jb.scjxdm from t2004,tax_jb where t2004.nsrmc = tax_jb.nsrmc
改成
update t2004 set t2004.street = (select tax_jb.scjxdm from t2004,tax_jb where t2004.nsrmc = tax_jb.nsrmc)
where exists (select tax_jb.scjxdm from t2004,tax_jb where t2004.nsrmc = tax_jb.nsrmc);
update t2004
set t2004.street = (
select distinct(tax_jb.scjxdm)
from t2004,tax_jb
where t2004.nsrmc = tax_jb.nsrmc)