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



How can I create a table from another table without copying any values from the old table?..

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

How can I create a table from another table without copying any values from the old table?..

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

How can I create a table from another table without copying any values from the old table?..

Answer / tejas wajge

create table emp as select * from project where rownum <1;

Is This Answer Correct ?    4 Yes 0 No

How can I create a table from another table without copying any values from the old table?..

Answer / srinivas

create table emp1
as
select * from scott.emp where rownum=0

Is This Answer Correct ?    3 Yes 0 No

How can I create a table from another table without copying any values from the old table?..

Answer / atul verma

SELECT *
INTO emp1
from scott.emp where rownum=0

Is This Answer Correct ?    0 Yes 0 No

How can I create a table from another table without copying any values from the old table?..

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

How can I create a table from another table without copying any values from the old table?..

Answer / sunil panghal

create table sunil as select *from hr.employees

Is This Answer Correct ?    0 Yes 2 No

How can I create a table from another table without copying any values from the old table?..

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

Post New Answer

More SQL PLSQL Interview Questions

What is sql catalog?

0 Answers  


How can you fetch first 5 characters of the string?

0 Answers  


What does an inner join do?

0 Answers  


i have a table like this. cityno cityname mails 1 BANGALORE 8KM 2 HSR LAYOUT 20KM 3 MEJISTIC 30KM 4 JAYADEVA 55KM 5 ITPL 80KM 6 HEBBAL 115KM I HAVE DATA LIKE THIS I WANT O/P LIKE THIS DISTANCE NO.OFCITY 0-50KM 3 51-100KM 2 101-150KM 4 AND SO ON pls give me answer. i want urgent

6 Answers  


Name three sql operations that perform a sort.

0 Answers  






How to start oracle sql developer?

0 Answers  


What are the advantages of sql?

0 Answers  


Why is sharding used?

0 Answers  


What is difference between rank () row_number () and dense_rank () in sql?

0 Answers  


How do I kill a query in postgresql?

0 Answers  


Differentiate between %type and %rowtype attribute in Oracle PL/AQL programming ?

7 Answers   PreVator,


Explain the purpose of %type and %rowtype data types with the example?

0 Answers  


Categories