Answers for "create table as select"

SQL
1

create table tablename as select * from tablename

CREATE TABLE new_table
  AS (SELECT * FROM old_table);
Posted by: Guest on March-08-2021
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.)
Posted by: Guest on August-09-2020
0

mysql select into new table

CREATE TABLE artists_and_works
  SELECT artist.name, COUNT(work.artist_id) AS number_of_works
  FROM artist LEFT JOIN work ON artist.id = work.artist_id
  GROUP BY artist.id;
Posted by: Guest on April-09-2020
0

sqlserver create table from select

Select * into new_table  from  old_table
Posted by: Guest on March-29-2021
0

sql create table with columns as another table

SELECT * INTO newtable FROM oldtable WHERE 1 = 0;
Posted by: Guest on December-07-2020

Code answers related to "create table as select"

Code answers related to "SQL"

Browse Popular Code Answers by Language