假設我有一個這樣的命令:從SELECT命令創建一個新表
select name, age, haircolor from people where shoesize > 10;
有沒有辦法,我可以創建基於什麼命令返回一個新表的方法嗎?我想將該命令的輸出傳送到一個新表中。
含義:
mysql> show tables;
+-----------------+
| Tables_in_db1 |
+-----------------+
| people |
+-----------------+
1 rows in set (0.00 sec)
mysql> CREATE TABLE FROM "select name, age, haircolor from people where shoesize > 10;";
..?
mysql> show tables;
+-----------------+
| Tables_in_db1 |
+-----------------+
| people |
| NEW TABLE |
+-----------------+
1 rows in set (0.00 sec)