Home » SQL & PL/SQL » SQL & PL/SQL » Create table
Create table [message #21790] Thu, 29 August 2002 21:21 Go to next message
Victoria
Messages: 152
Registered: July 2002
Senior Member
Hi,
CAn anyone tell me how to create a table similar to existing table?The new ly created table should be empty after creation.

create table temp
as select * from table;

I can use this but it will put data also.
Thanks and Regards
Victoria
Re: Create table [message #21791 is a reply to message #21790] Thu, 29 August 2002 21:32 Go to previous messageGo to next message
mala
Messages: 18
Registered: March 2001
Junior Member
You can try this to copy the structure alone.

create table t1 as select * from t2 where 1=2
Re: Create table [message #21793 is a reply to message #21790] Thu, 29 August 2002 23:14 Go to previous messageGo to next message
PRAVEEN KUMAR SINGH
Messages: 1
Registered: August 2002
Junior Member
create table temp
where exittable1.null=temp.null;
Re: Create table [message #21796 is a reply to message #21790] Fri, 30 August 2002 08:15 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Incorrect.
Previous Topic: Reg DECODE
Next Topic: what is a CTAS in oracle
Goto Forum:
  


Current Time: Tue Apr 23 06:06:57 CDT 2024