經常使用技巧

存儲過程當中,如何在字符串中使用變量spa

例: 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表code

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 ...)

 

 

 

 

 

 

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------blog

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------字符串

相關文章
相關標籤/搜索