CREATE TABLE CLONE
Creates a table clone based on a source table. The source table can be a table, a table clone, or a table snapshot.
Grammar Syntax
CREATE [ OR REPLACE ] TABLE [ IF NOT EXISTS ] destination_table_name CLONE source_table_name [FOR SYSTEM_TIME AS OF time_expression] ... [OPTIONS(table_option_list)]
Sample InputCode
CREATE TABLE mytable
CLONE anothertable FOR SYSTEM_TIME AS OF CURRENT_TIMESTAMP();Snowflake OutputCode
CREATE TABLE mytable
CLONE anothertable AT (TIMESTAMP => CURRENT_TIMESTAMP() /*** MSC-ERROR - MSCEWI1073 - PENDING FUNCTIONAL EQUIVALENCE REVIEW FOR 'CURRENT_TIMESTAMP' NODE ***/);Sample InputCode
CREATE TABLE `table_clone`
CLONE `table1`
OPTIONS(
expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 365 DAY),
friendly_name="my_clone_table",
description="table cloned from table1",
labels=[("org_unit", "development")]
);Snowflake OutputCode
Note
Related EWIs
Last updated
Was this helpful?