Home

Copying a Table

 

Description

If you have a table with columns or records you want to use without damaging the table, for example to perform some test, you can copy the table to get a new one that is similar but only different by name.

To copy a table in SQL, you can use the following formula:

CREATE TABLE NewTableName AS SELECT * FROM ExistingTable;

Here is an example:

CREATE TABLE Contractors AS SELECT * FROM Employees
 
     
 

Home Copyright © 2009-2016, FunctionX, Inc.