Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[experiment] verify that the primary key experiment cannot be created by create table as select

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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 (1Pol 1)

1 row created.

Sec@ora10g > insert into test1 values (2jue 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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report