update table1 set name='newvalue' where id = (select id from table2 where address='address');
解决方案 »
- 无法更新Oracle数据库的某些表
- oracle 11g的dmp文件导入oracle 10g
- oracle数据库备份
- [求助]想成为一名Oracle的DBA,大概需要几年的学习?
- 如何恢复drop掉的表啊??????????????????????????
- 求助 SQL分组查询
- 过程错误请各位高手指点 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 按照时间导出表中的一部分内容!请教各位大侠!
- ADO操纵Oracle的问题,高手指教!!
- 如何在oracle8.1.7的图形界面中实现id值自动增加
- 两个表间的 update 问题
- 装上Oracle 8之后,每次启动的时候都有问题
where exists
(select 1 from table2 where table1.id=table2.id);
table2(id,address)
table1 的id 和table2的id之相同。
我想通过与table2的关联 更新table1 的name值,请问该怎么写update 语句?
------------------------------------------------------------------
你的意思是不是这样的:
update table1 a set name='aaa' where id=(select id from table2 b where a.id=b.id and b.address='xxx');
------------------------------------------------------------------