Skip to content
The Chat Archive
gpt-3.5-turbo-0301· OpenAI WildChat-4.8M (AI2)

athena create table as select

  1. User

    athena create table as select

  2. Assistant

    I'm sorry, as a language model AI, I cannot create tables here as I am not connected to any database. However, I can provide you with an example query for the Athena create table as select statement:

    To create a table named "sales_data" with data already present in another table called "orders" in Athena, use the following create table as select statement:

    CREATE TABLE sales_data
    AS
    SELECT *
    FROM orders
    WHERE order_date BETWEEN '2021-01-01' AND '2021-03-31'
    

    This query creates a new table "sales_data" that contains all columns and rows from the "orders" table where the "order_date" falls between January 1, 2021, and March 31, 2021.