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
