411 REFERENCE · Wikibooks
SQL Dialects Reference/Write queries/Save results from select query as new table
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Save results from select query as new table
Problem: save results from an arbitrary SELECT query (SELECT columns FROM table ...) as a new permanent table new_table.
SELECT columns INTO new_table FROM table ...
CREATE TABLE new_table [AS] SELECT columns FROM table ... SELECT columns INTO new_table FROM table ... CREATE TABLE new_table AS SELECT columns FROM table ... CREATE TABLE new_table AS SELECT columns FROM table ... WITH DATA create-table.html CREATE TABLE new_table [AS] SELECT columns FROM table ... CREATE TABLE new_table [AS] SELECT columns FROM table ... CREATE TABLE new_table [AS] SELECT columns FROM table ... CREATE TABLE new_table [AS] SELECT columns FROM table ...