【转载】【实验】验证通过create table as select 方式无法创建主键小实验
来源:互联网 发布:问卷录入软件 编辑:程序博客网 时间:2024/06/05 09:15
sec@ora10g> create table test1 ( a number primary key, b number not null);
Table created.
sec@ora10g> desc test1;
Name Null? Type
---------------------- -------- ------------------
A NOT NULL NUMBER
B NOT NULL NUMBER
sec@ora10g> insert into test1 values (1,1);
1 row created.
sec@ora10g> insert into test1 values (2,2);
1 row created.
sec@ora10g> COMMIT;
Commit complete.
sec@ora10g> create table test2 as select * from test1;
Table created.
sec@ora10g> desc test2;
Name Null? Type
--------------------- -------- ------------------
A NUMBER
B NOT NULL NUMBER
sec@ora10g> select * from test1;
A B
---------- ----------
1 1
2 2
sec@ora10g> select * from test2;
A B
---------- ----------
1 1
Table created.
sec@ora10g> desc test1;
Name Null? Type
---------------------- -------- ------------------
A NOT NULL NUMBER
B NOT NULL NUMBER
sec@ora10g> insert into test1 values (1,1);
1 row created.
sec@ora10g> insert into test1 values (2,2);
1 row created.
sec@ora10g> COMMIT;
Commit complete.
sec@ora10g> create table test2 as select * from test1;
Table created.
sec@ora10g> desc test2;
Name Null? Type
--------------------- -------- ------------------
A NUMBER
B NOT NULL NUMBER
sec@ora10g> select * from test1;
A B
---------- ----------
1 1
2 2
sec@ora10g> select * from test2;
A B
---------- ----------
1 1
2 2
转载自:点击打开链接
0 0
- 【转载】【实验】验证通过create table as select 方式无法创建主键小实验
- Create table as select
- create table as select
- oracle create table as select
- Oracle Create Table as Select
- 浅谈create table as select
- CREATE INDEX 小实验
- postgres create table as select & create table like
- MySql create table ... as select * from ..
- Select into from 与 Create Table As
- create table as select性能测试
- sqlserver不能直接create table as select ......
- sqlserver不能直接create table as select ......
- create table as select性能测试
- create table as select性能测试
- sqlserver不能直接create table as select ......
- hive orc创建出错create as select
- create table as select 和 create table 再insert into select 的差异
- 真Unity3d_人物摇杆操作
- 《计算几何》听课小笔记>
- 建议6 区别readonly和const的使用方法
- javascript中面向对象特性、对象的创建方式及对象属性的特性
- 《谷歌和亚马逊如何做产品》读后感
- 【转载】【实验】验证通过create table as select 方式无法创建主键小实验
- 1127. ZigZagging on a Tree (30)
- 计算机网络之数据链路层(笔记)
- 1
- 删除D盘空目录 、检索大于10M的文件
- 苦恼的window
- 周志华《机器学习》第 1 章 绪论
- 建议7 将0值作为枚举的默认值
- java线程模型