copy data from one table to another

Solutions on MaxInterview for copy data from one table to another by the best coders in the world

showing results for - "copy data from one table to another"
Ana
17 Jan 2021
1Let’s assume that, we have our employee table.
2We have to copy this data
3into another table. For this purpose,
4we can use the INSERT INTO SELECT
5operator. Before we go ahead and do that,
6we would have to create another
7table that would have the same structure
8as the given table.
9First create the second table with
10the same table structure with copied one.
11Then use the syntax:
12Let’s say employee_duplicate is New table
13employee is First table that we want to copy it into new table
14
15INSERT INTO employee_duplicate SELECT * FROM employee;