The following articles mainly introduce MySQL select into and SQLServer select, we all know that the MySQL database does not support the structure of the direct backup table for the Select Into statement and the actual application data. As a result, you need to find a method on the Internet to replace it, there are other methods to deal with, summarized as follows:
Method 1:
MYSQL does not support:
- Select * Into new_table_name from old_table_name
Alternative method:
- Create table new_table_name (Select * from old_table_name);
Method 2:
1. Back up the table structure and data first.
Export command-u user name-p password-h Host IP Address Database Name table name 1> export file. SQL
- mysqldump -uroot -proot -h192.168.0.88 ok_db oktable2 > ok_db.sql
2. Modify the name of the backup table
3. log on to MySQL
4. Select a database
5. Run the following command: Source backup table path: Source d: \ OK _db. SQL, and press Enter.
6. Complete.
SQLServer supports MySQL Select into statements
1. Run the following command to back up the table.
- Select * Into new_table_name from old_table_name;
MySQL Select into outfile is used to export the specified data to the file:
1.export all data in the table to the cdisk root directory outfile.txt as follows:
- Select * into outfile 'c:\\outfile.txt' from test;
2. In the export table, specify the data with the query Condition No. 2005-06-08to the cdisk root directory outfile1.txt as follows:
- Select * into outfile 'c:\\outfile.txt' from test where beginDate='2008-06-08';
Source: Baidu