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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the primary key?

549


How do I create a memory optimized filegroup?

537


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

614


What does := mean in pl sql?

567


What is a record in a database?

565






What is pl sql and why it is used for?

581


Is sql workbench free?

544


what is self-join? : Sql dba

580


What is sql performance tuning?

504


What is asqueryable?

541


How do you update f as m and m as f from the below table testtable?

1110


Is record in pl sql?

523


What is the difference between an inner and outer join?

550


Can ddl statements be used in pl/sql?

602


What are instead of triggers?

632