create table from select code example
Example 1: how to create a table structure from another table in mysql
CREATE TABLE new_tbl LIKE orig_tbl; //(creates an empty table only definition is
same.)
Example 2: how to create a table based on another table in mysql
Press CTRL+C to copy CREATE TABLE new_tbl [AS] SELECT * FROM orig_tbl;
Example 3: sql create table with columns as another table
SELECT * INTO newtable FROM oldtable WHERE 1 = 0;