copy table in sql

Solutions on MaxInterview for copy table in sql by the best coders in the world

showing results for - "copy table in sql"
Michelle
17 May 2020
1-- Use SELECT ... INTO:
2SELECT * INTO my_table_1 FROM my_table;
3-- Structure only:
4SELECT * INTO my_table_1 FROM my_table WHERE 1 <> 1;
Adaline
06 May 2017
1CREATE TABLE employees_copy
2AS 
3SELECT first_name, last_name, email FROM employees WHERE 1=0;
Safiya
09 May 2020
1#The SELECT INTO statement selects data from one table and inserts it into a different table. 
2#The SELECT INTO statement is most often used to create backup copies of tables. 
3syntax->SELECT *
4INTO new_table_name [IN externaldatabase]
5FROM old_tablename 
6///example///
7SELECT *
8INTO Persons_Backup
9FROM Persons