Home » SQL & PL/SQL » SQL & PL/SQL » how to create table with structure only based on another table with data
how to create table with structure only based on another table with data [message #18354] Tue, 29 January 2002 06:13 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,
how to create table with structure only based on another table with data.
I have table1 with 100 records,
now i want to create table2 with the same structure as table1 but without the data.
Re: how to create table with structure only based on another table with data [message #18355 is a reply to message #18354] Tue, 29 January 2002 06:37 Go to previous message
sokeh
Messages: 77
Registered: August 2000
Member
try:
create first_table as
select * from original_table
where 1=2;
that way, 1 is not going to be 2 and all data structure is moved over to the new table without data.
Previous Topic: Query error frustrating beginner
Next Topic: Select in update
Goto Forum:
  


Current Time: Tue May 26 20:51:43 CDT 2020