SQL Select Into


The SELECT INTO statement copies data from one table into a new table.

Here’s the syntax for copying all columns to a new table. It’s like making a backup. For you information, Google’s BigQuery doesn’t currently recognize the SELECT INTO command.

Replace newtable below with your table name. You may not need to include the IN clause. Replace oldtable below with the name of your existing table. You might not need the WHERE clause. Remove it if you don’t need it.

SELECT *
INTO newtable [IN externaldb]
FROM oldtable
WHERE condition;

For more information, have a look at w3schools.com‘s article on SELECT INTO.

Leave a Reply