Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Duplicate Table From Existing Table [duplicate]

Tags:

oracle

Possible Duplicate:
SELECT INTO using Oracle

I have one table in my oracle database. I want to create one table with another name, but containing same data. How to achieve this ?

like image 510
Lucifer Avatar asked Jan 25 '12 03:01

Lucifer


People also ask

How can we create duplicate table from existing table in SQL Server?

Right-click the table you wish to duplicate, point to Script Table as, then point to CREATE to, and then select New Query Editor Window. Change the name of the table. Remove any columns that are not needed in the new table. Select Execute to create the new table.

How do I copy an existing table?

Step 1 − Get the complete structure about the table. Step 2 − Rename this table and create another table. Step 3 − After executing step 2, you will clone a table in your database.


1 Answers

Use this query to create the new table with the values from existing table

CREATE TABLE New_Table_name AS SELECT * FROM Existing_table_Name;  

Now you can get all the values from existing table into newly created table.

like image 103
Gurujothi.D Avatar answered Oct 08 '22 03:10

Gurujothi.D