MySQL: Creating a new table with information from a query

后端 未结 3 1871
情书的邮戳
情书的邮戳 2021-02-03 18:16

In MySQL, I would like to create a new table with all the information in this query:

select * into consultaa2 from SELECT
 CONCAT(    \'UPDATE customers SET
 cus         


        
3条回答
  •  灰色年华
    2021-02-03 19:10

    You can do it like this:

    CREATE TABLE tablename SELECT * FROM othertable;
    

    tablename is the name of the new table you want to create, SELECT * FROM othertable is the query that returns the data the table should be created from.

提交回复
热议问题