您的位置:首页 > 数据库

SQL一个表的数据更新到另一个表

2011-11-26 12:14 288 查看
Oracle:

update (

select a.xingming yy ,b.keshiid xx

from z_dangan a,z_dangan_mx b

where a.danganid=b.danganid and a.zhuyuanhao='450177'

) c

set c.yy= c.xx ;

SQLServer:

update A表 set t1.lanmu_code = t2.code from A表 t1,B表 t2 where t1.lanmu_id = t2.id

还有一种方法:Excel 可以直接在PLSQL Developer中中多列Ctrl+C 和Ctrl+V 到另一个表。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: