点击此处浏览总目录

常用技巧

存储过程中,如何在字符串中使用变量

例: select to_char(sysdate,'yyyymmdd') into v_yyyymmdd from dual;
   execute immediate('create table tableName_bk_' || v_yyyymmdd || ' as select * from TableName');

 

 将A表和B表进行关联,将符合关联条件的B表字段值更新至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 ...)

 

 

 

 

 

 

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

posted @ 2019-04-09 17:03  立业的博客  阅读(145)  评论(0编辑  收藏  举报