Description
TheINSERT INTO statement inserts data into a table. The data comes from a subselect query. It is commonly used to input prediction results into a database table.
Syntax
Here is the syntax:integration_name.table_name) must
exist and contain all the columns where the data is to be inserted.
And the steps followed by the syntax:
- It executes a subselect query to get the output dataset.
- It uses the
INSERT INTOstatement to insert the output of the(SELECT ...)query into theintegration_name.table_nametable.
Example
We want to save the prediction results into theint1.tbl1 table.
Here is the schema structure used throughout this example:
| Name | Description |
|---|---|
int1 | Integration where the table that stores prediction results resides. |
tbl1 | Table that stores prediction results. |
predictor_name | Name of the model. |
int2 | Integration where the data source table used in the inner SELECT statement resides. |
tbl2 | Data source table used in the inner SELECT statement. |