v1.1
Data Imported into a Time-Series Table Using Standard SQLs
Sensor or monitoring data can be inserted into a time-series table using standard SQLs. One or more data records can be inserted at one time. Before data write, you need to create a time-series table, or ensure that there are time-series tables in the system.
Precautions
- You do not have to insert the time column.
- Data can be imported out of order (Chunks that are not compressed can be inserted out of order in this version).
- The
tstime
column does not support NULL. - The
tstag
column does not support NULL.
Syntax Format
-
Insert a single data record.
INSERT INTO table_name[(targelist)] VALUES(value_list);
-
Insert multiple data records.
INSERT INTO table_name[(targelist)] VALUES(value_list)[, (value_list)]...;
Examples
MogDB=# INSERT INTO weather(time, city, location, temperature) VALUES('2022-07-06 00:00:00','beijing', 'gongyuan', 29.1);
INSERT 0 1
MogDB=# INSERT INTO weather(time, city, location, temperature) VALUES('2022-07-06 00:00:00','beijing', 'chaoyang', 29.1), ('2022-7-6 00:00:00','shanghao', 'gongyuan', 29.2);
INSERT 0 2