由于mysql不支持select into 方法,mysql怎样将一张表的查询结果存到另一张表中?

找了两个方法

第一种:

create table dust select * from student;//用于复制前未创建新表dust的情况下

第二种

insert into dust select * from student;//已经创建了新表dust的情况下

----------------------------------------------------------------------

如果表结构不一样

insert into 表1 (列名1,列名2,列名3) select 列1,列2,列3 from 表2

不同数据库,需要在表前面加数据库前缀,database.表名。

注意:以上测试过OK,sql语句不需要在insert后面加values。

=============================

测试语句为:insert into xx_company_templates (REL_ID,SET_TIME) select COMPANY_ID,CREATE_TIME from xx_company

最新文章

  1. Thinkphp 3.2.2 验证码check_verify方法,只能验证一次
  2. .NET core mvc on Docker
  3. VS-Visual Studio-IIS Express 支持局域网访问
  4. WIN8 浏览器排版不兼容问题
  5. codeforces 489C.Given Length and Sum of Digits... 解题报告
  6. mysql基础知识(4)--修改
  7. windowSoftInputMode属性详解
  8. Jersey(1.19.1) - Hello World, Get started with Jersey using the embedded Grizzly server
  9. Spring系列
  10. Mybatis 中一对多,多对一的配置
  11. mysql学习笔记02 表的操作
  12. 软件配置管理及SVN的使用
  13. 几个简单排序算法的Python实现
  14. RestTemplete
  15. ReactiveX 学习笔记(20)使用 RxJava + RxBinding 进行 GUI 编程
  16. windows命令行下杀死进程的方法
  17. 单线程的redis为什么吞吐量可以这么大
  18. [Transducer] Make Transducer works for Iteratable collection and Object
  19. python环境搭建-Linux系统下python2.7升级python3.5.2步骤
  20. BZOJ 2208 连通数(强连通分量)

热门文章

  1. 【转】Qt 资源图片删除后,错误 needed by `debug/qrc_image.cpp'. Stop. 的终极解决办法
  2. LeetCode NO477.汉明距离总和
  3. Some notes of The Peter Principle
  4. 安装Angulr CLI
  5. 第一章 Vue介绍
  6. anaconda应答文件
  7. css3 扇形动画
  8. 使用nodejs进行开发,concurrently模块,使我们同时执行多个命令。
  9. 《剑指offer》算法题第十二天
  10. Libreoffice/Office:禁止首字母自动大写功能