创建数据库
https://www.taosdata.com/docs/cn/v2.0/taos-sql#-1
CREATE DATABASE stock_hq KEEP 36500 DAYS 2 BLOCKS 4 UPDATE 1;
建表
https://www.bookstack.cn/read/TDengine/139296
超级表
CREATE STABLE thermometer (ts timestamp, degree double) TAGS(location binary(20), type int);
子表
CREATE TABLE therm1 USING thermometer TAGS ('beijing', 1);
CREATE TABLE therm2 USING thermometer TAGS ('beijing', 2);
CREATE TABLE therm3 USING thermometer TAGS ('tianjin', 1);
CREATE TABLE therm4 USING thermometer TAGS ('shanghai', 3);
插入数据
INSERT INTO therm1 VALUES ('2018-01-01 00:00:00.000', 20);
INSERT INTO therm2 VALUES ('2018-01-01 00:00:00.000', 21);
INSERT INTO therm3 VALUES ('2018-01-01 00:00:00.000', 24);
INSERT INTO therm4 VALUES ('2018-01-01 00:00:00.000', 23);