I have a big table in MySQL database and I want to create a new table with all the data in it. I have heard that there is SQL statement "mysql select into new table" which selects the data from one table and create and insert data into new table. What is the correct statement for selecting the records from one table and creating and inserting the data into another table?
Hi suppose you have a table1 and you want to save all the records from table1 into another table. Then follow the steps given below:
First of create a table table2 with the same structure as table1.
Now run the following statement:
insert INTO table2 SELECT * from table1;
Above sql statement will insert all the data from table1 into table2.