0 votes
1 view
in SQL by (22.4k points)

I know the statement:

create table xyz_new as select * from xyz;

Which copies the structure and the data, but what if I just want the structure?

1 Answer

0 votes
by (40.3k points)
edited by

You can use Where clause because it won’t select any rows:

create table xyz_new as select * from xyz where 1=0;

Are you interested in learning SQL from the basics! Refer to this video on SQL provided by Intellipaat:

Note: When you are creating a copy of an ORACLE table without copying the data then the things such as: indexes, triggers, sequences, materialized view logs, things that don’t handle partitions and some constraints also won't be copied to the new table from the original table. 

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...