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

write a qurey for finding the length of the sting.

6 Answers   Infosys, TCS,


what is sp_pkeys? : Transact sql

0 Answers  


Is sql open source?

0 Answers  


How subquery works in sql?

0 Answers  


1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins

0 Answers   CTS,






Are sql views compiled?

1 Answers  


what is rollback? : Sql dba

0 Answers  


mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql

0 Answers  


in sql table following column r there i want find 1st paid ,2nd paid,3rd paid date for same |service_type|date |vehicle_no| |------------|------|_---------| |paid |23 jan|MH12H2007 | | | | | |paid |26 feb|MH12H2007 | | | | | | | | | |paid |28 mar|MH12H2007 | i want o/p like below vehicle no| 1st paid date | 2nd paid date|3rd paid |latest paid date| pls help me out

4 Answers  


What is the difference between null value, zero, and blank space?

0 Answers  


type type_name is table of varchar2(30) index by binary_integer for the above type you have to create a identifier... like identifier_name type_name; for the above type you can use the below methods..like first , last , prior, next , delege..etc...like this.. if you create a cursor...like cursor cursor_name is select * from scott.emp; is there any methods like above to use prior, fist , last , next , trim ,etc...

1 Answers   Satyam,


What is type and rowtype in pl sql?

0 Answers  


Categories