table1
id name
1 张三
2 李四
3 王五
(此表ID号唯一,且不为空)
table2
id name
1 空
空 空
2 空
2 空
(此表ID列值不唯一,也有可能为空)求助:如何将table2表中ID号与table1一致的name替换成table1表中的nmae,期望结果如下:
table2
id name
1 张三
空 空
2 李四
2 李四
id name
1 张三
2 李四
3 王五
(此表ID号唯一,且不为空)
table2
id name
1 空
空 空
2 空
2 空
(此表ID列值不唯一,也有可能为空)求助:如何将table2表中ID号与table1一致的name替换成table1表中的nmae,期望结果如下:
table2
id name
1 张三
空 空
2 李四
2 李四
解决方案 »
- 过程修改
- developer 9i删除之后,怎样把服务里的相关内容删掉
- 求一个有关变异表的解决方法
- 对象表REF:oracle对象表和关系表区别和理解?(对象表中是否有数据?)
- 关于一个Distinct的查询...
- 请问各位大侠们,怎样在查询过程中暂停时间(如暂停5秒)~
- 请问一个SQL查询的问题
- 把oracle某数据库中的某些表(含数据),导到sqlserver来,sqlserver中原本可能没有相同的表。可能有。如何写啊.
- ORA-01000 超出打开游标的最大数错误 ???
- PL/SQL中查询同义词,为什么打开了需要提交
- oracle自动存档怎么恢复数据
- 为什么我在服务器上用exp导出的dmp备份文件,还原后发现至少少了一张表?
set a.name=
(
select b.name from table1 b where a.id=b.id
)
where exists
(
select 1 from table1 b where a.id=b.id
)