Create tables from queries with Redshift
11 Jul 2019As a convenience to the developer, AWS Redshift offers CTAS for those times where you need to materialise a physical table from the result of a query.
Syntax
Re-produced from the documentation.
As you can see, this is basically a CREATE TABLE
statement, with a SELECT
query at the end of it.
The new table is loaded with data defined by the query in the command. The table columns have names and data types associated with the output columns of the query. The CREATE TABLE AS (CTAS) command creates a new table and evaluates the query to load the new table.