YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Maintenance and Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Configuration Parameters
SQL Reference
FAQ
Define a new table based on the query results.
[ WITH [ RECURSIVE ] with_query [, ...] ]
SELECT [ALL | DISTINCT [ON ( expression [, ...] )]]
* | expression [AS output_name] [, ...]
INTO [TEMPORARY | TEMP | UNLOGGED ] [TABLE] new_table
[FROM from_item [, ...]]
[WHERE condition]
[GROUP BY expression [, ...]]
[HAVING condition [, ...]]
[{UNION | INTERSECT | EXCEPT} [ALL | DISTINCT ] select]
[ORDER BY expression [ASC | DESC | USING operator] [NULLS {FIRST | LAST}] [, ...]]
[LIMIT {count | ALL}]
[OFFSET start [ ROW | ROWS ] ]
[FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]
[FOR {UPDATE | SHARE} [OF table_name [, ...]] [NOWAIT]
[...]]
SELECT INTO creates a new table and fills the table with the data calculated by the query. Data is not returned to the client like a regular SELECT. The columns of the new table have the name and data type associated with the output column of SELECT.
SELECT Most parameters of INTO are the same as SELECT.
TEMPORARY
TEMP
UNLOGGED
new_table
Create a new table films_recent that contains only the latest entries in the table films:
SELECT * INTO films_recent FROM films WHERE date_prod >= '2016-01-01';
The SQL standard uses SELECT INTO to select values into scalar variables of the host program instead of creating a new table. The usage of SELECT INTO in YMatrix databases for table creation is historical. For this purpose, it is best to use CREATE TABLE AS in new applications.