我需要把一个查询结果导成一个表 
sqlserver 有一个语句轻松做到select * into a from b
不知道mysql如何实现?

解决方案 »

  1.   

    create table a 
    as
    select * from b
      

  2.   


    楼上正解。或者可以把AS省略掉  create table a select * from b;其它 的什么先 create table like ,再 insert 就不用考虑了。
      

  3.   

    官方语法说明CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
    [IGNORE | REPLACE] [AS] SELECT ...   (Some legal select statement)
      

  4.   

    insert into a select * from b;
    可以写成这种形式
      

  5.   

    mysql:
    create table newtt as select * from oldtt