There are two scenarios when copying data from one dataset to another. The first is where the columns are the same and the second is where they are different.
The first query is rather simple:
INSERT INTO dataset_XXXXX ( SELECT * from dataset_YYYYY );
The second query is doing the same thing, but is allows for assigning specific columns or perhaps populating default values.
INSERT INTO dataset_XXXXX (col1, col2, col3, col4 ) SELECT col1, col2, col3, 'default' as col4 from dataset_YYYYY;
Comments
0 comments
Please sign in to leave a comment.