How can I create a table from another table without copying
any values from the old table?
Answers were Sorted based on User's Feedback
Answer / anji
create table table_name as ( select * from old_table where 1=2)
from this query we can create a new table structure from old
table structure with out data
Is This Answer Correct ? | 26 Yes | 1 No |
Answer / suresh babu
create table new_tn as select * from source_tn where 1=2;
This query will create a new table,which take structure of
the source table with out values.
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / tejas wajge
create table emp as select * from project where rownum <1;
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / srinivas
create table emp1
as
select * from scott.emp where rownum=0
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / atul verma
SELECT *
INTO emp1
from scott.emp where rownum=0
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ram
In oracle
Create table newtablename as select * from oldtablename
where 1=2
(any false condition if condition true it copies data from
table it applicable for both oracle & sqlserver)
In Sql server
select * into newtablename from oldtablename where 1=2
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sunil panghal
create table sunil as select *from hr.employees
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / shabana
Use the describe command to display the table structure
then use the create table command and copy the table
structure in your command.
Is This Answer Correct ? | 1 Yes | 11 No |
How do you create an update query?
what are the advantages of sql ? : Sql dba
What is integrity constraints?
How do you remove duplicate records from a table?
What is ON DELETE CASCADE?
What has stored procedures in sql and how we can use it?
What are pl/sql cursors?
What is the difference between the conventional and direct path loader? : aql loader
I need a function for a train ticket reservation please answer it thanks in advance
What is delimiter sql?
Is left join same as inner join?
what is the difference difference between procedure and packages
2 Answers 3i Infotech, Oracle,