数据库 根据A表 更新B表

来源:互联网 发布:扎金花闷牌算法 编辑:程序博客网 时间:2024/04/29 15:20
--------------------oracle 根据A表 批量更新B表----------------------
update t_b_loans a set a.create_by_org=
(select b.org_code from t_s_depart b where a.setup_tsdepart_id = b.id) where exists
(select * from t_s_depart c where c.id=a.setup_tsdepart_id)
commit;


--------------------mysql 根据A表 批量更新B表----------------------
UPDATE table_a,table_b SET table_a.age=table_b.age WHERE table_a.id=table_b.id;
0 0
原创粉丝点击