BigQuery Equivalent of “CREATE TABLE my_table (LIKE your_table)”

后端 未结 2 511
半阙折子戏
半阙折子戏 2021-01-13 18:17

I want to create a table which schema is exactly the same as another table. In other SQL engines, I think I was able to use \"CREATE TABLE my_table (LIKE your_table

2条回答
  •  [愿得一人]
    2021-01-13 18:45

    To create a partitioned and/or clustered table the syntax would be:

    CREATE TABLE project.dataset.clustered_table PARTITION BY DATE(created_time) CLUSTER BY account_id AS SELECT * FROM project.dataset.example_table LIMIT 0

提交回复
热议问题