1、新建表

create table ACCT_LOAN

(

  data_date      INTEGER not null,  --整数,也可以约束数字最大位数,不可为空

acct_num       VARCHAR2(35) not null,  --可变长度的字符串(包含数字。字母及特殊字符)

curr_cd        CHAR(3),  --固定长度为3的字符串(可包含数字,字母及特殊字符)

drawdown_dt       DATE,  --日期

loan_amt           decimal(8,2)  --小数,小数最大长度为8位,小数位固定为2位

2、建备份表

create table 备份表名 as select * from 表名;

3、将两张相同结构的表合并在一起

insert into 表1 select * from 表2 where ...;

commit;

4、更新表:merge into

merge into 表1

using 表2

on (表1.字段=表2.字段)

when matched  then

update set ...

when not matched then 

insert values(表2.xx, 表2.xx,...);

commit;

5、给变量赋值

select into 变量名

from 

相关文章:

  • 2021-08-17
  • 2021-11-30
  • 2021-09-26
猜你喜欢
  • 2021-11-27
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案