我们今天主要向大家描述的是MySQL select into 与 SQLServer select into的实际应用以及在其实际运行中那些项目是值得我们大家注意的。

以下的文章首要介绍的是MySQL select into与 SQLServer select into,咱们我们都知道MySQL数据库是对Select Into 句子的直接备份表的结构与相关实践使用数据是不支撑的,因为工作中的需求在网上找到一种办法能够代替, 也有其它办法能够处理,总结如下:

MySQL select into,SQLServer  into 第1张

办法1:

MYSQL不支撑:

  1. Select*Intonew_table_namefromold_table_name

代替办法:

  1. Createtablenew_table_name(Select*fromold_table_name);

办法2:

1.先备份表结构和数据

导出指令 -u用户名 -p暗码 -h主机IP地址 数据库名 表名1 > 导出文件.sql

  1. mysqldump-uroot-proot-h192.168.0.88ok_dboktable2>ok_db.sql

2.修正备份表的姓名

3.登录MySQL

4.挑选数据库

5.履行: Source 备份表的途径 如:Source d:\ok_db.sql 回车即可。

6.完结.

SQLServer支撑 MySQL Select into句子

1.备份表直接履行如下就能够了。

  1. Select*Intonew_table_namefromold_table_name;

MySQL Select into outfile用于导出指定的查询数据到文件如下:

1.导出表中所有数据到C盘根目录outfile.txt中如下:

  1. Select*intooutfile'c:\\outfile.txt'fromtest;

2.导出表中指定查询条件2005-06-08号的数据到C盘根目录outfile1.txt中如下:

  1. Select*intooutfile'c:\\outfile.txt'fromtestwherebeginDate='2008-06-08';

来历:百度

转载请说明出处
知优网 » MySQL select into,SQLServer select into

发表评论

您需要后才能发表评论