建立實體TABLE,Table名稱叫做ZZZ
並且有四個欄位,分別為AAA1,AAA2,AAA3,AAA4
default 是預設值
not null 是不為空
Create Table ZZZ(
AAA1 varchar2(5) default 'test' not null,
AAA2 date default sysdate,
AAA3 nvarchar2(5),
AAA4 number(10,0)
);
建立暫存TABLE
Create Global Temporary Table ZZZ(
AAA1 varchar2(5) default 'test' not null,
AAA2 date default sysdate,
AAA3 nvarchar2(5),
AAA4 number(10,0)
) on commit delete rows ;
建立暫存TABLE
Create Global Temporary Table ZZZ(
AAA1 varchar2(5) default 'test' not null,
AAA2 date default sysdate,
AAA3 nvarchar2(5),
AAA4 number(10,0)
) on commit Preserve rows ;
刪除Table
Drop Table ZZZ;
修改Table
增加欄位
Alter Table ZZZ
Add AAA5 date;
刪除欄位
Alter Table ZZZ
Drop Column AAA3;
修改型別
將AAA1型別修改成Date
Alter Table ZZZ
Modify AAA1 date;
增加PKEY
Alter Table ZZZ
Add Constraint PK_AAA1 Primary Key(AAA1);
留言列表