码迷,mamicode.com
首页 > 其他好文 > 详细

表字段部分更新

时间:2016-05-17 20:00:45      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:pl/sql

问题:用一张表的数据更新另外一张表部分字段

解决:

update table1 t1
set (t1.col1, t1.col2) = (select t2.col1, t2.col2
  from table2 t2
  where t1.key = t2.key)
where t1.key in(select key from table2);




本文出自 “IT技术学习与交流” 博客,谢绝转载!

表字段部分更新

标签:pl/sql

原文地址:http://qing0991.blog.51cto.com/1640542/1774318

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!