常用技巧
程序员文章站
2022-05-21 17:17:31
存储过程中,如何在字符串中使用变量 将B表中符合关联条件的A表字段值更新至A表 ......
存储过程中,如何在字符串中使用变量
例: select to_char(sysdate,'yyyymmdd') into v_yyyymmdd from dual; execute immediate('create table tablename_bk_' || v_yyyymmdd || ' as select * from tablename');
将b表中符合关联条件的a表字段值更新至a表
update tablea a set a1,a2,a3=(select b1,b2,b3 from tableb b where a.column_name1 = b.column_name1 and a.column_name2 = b.column_name2 and ...)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
上一篇: 服务器端 安装svn
下一篇: PGA