alter_examples_bash

This commit is contained in:
fang 2019-08-05 10:41:28 +08:00
parent 775fda8df3
commit 0a3006f2b5
2 changed files with 19 additions and 23 deletions

View File

@ -1,11 +1,10 @@
1503851026421, 1 1503851026421, 220, 1.10
1503851026422, 2 1503851026422, 221, 1.20
1503851026423, 3 1503851026423, 219, 1.09
1503851026424, 4 1503851026424, 222, 1.11
1503851026425, 5 1503851026425, 220, 1.08
'2019-07-22 10:00:01.000', 219, 1.06
'2019-07-22 10:00:01.000', 6 '2019-07-22 10:00:02.000', 218, 1.04
'2019-07-22 10:00:02.000', 7 '2019-07-22 10:01:02.000', 220, 1.12
'2019-07-22 10:01:02.000', 8 '2019-07-22 11:01:02.000', 221, 1.11
'2019-07-22 11:01:02.000', 9 '2019-07-23 11:01:02.000', 220, 1.09
'2019-07-23 11:01:02.000', 10

1 1503851026421 1 220 1.10
2 1503851026422 2 221 1.20
3 1503851026423 3 219 1.09
4 1503851026424 4 222 1.11
5 1503851026425 5 220 1.08
6 '2019-07-22 10:00:01.000' 6 219 1.06
7 '2019-07-22 10:00:02.000' 7 218 1.04
8 '2019-07-22 10:01:02.000' 8 220 1.12
9 '2019-07-22 11:01:02.000' 9 221 1.11
10 '2019-07-23 11:01:02.000' 10 220 1.09

View File

@ -1,17 +1,14 @@
create database if not exists db0 create database if not exists db0
create table if not exists db0.tb0 (ts timestamp, field int) create table if not exists db0.tb0 (ts timestamp, voltage int, current float)
import into db0.tb0 file demo.csv import into db0.tb0 file demo.csv
create database if not exists db1 create database if not exists db1
use db1 use db1
create table if not exists tb1 (ts timestamp, name binary(8)) create table if not exists tb1 (ts timestamp, temperature int, humidity float)
insert into tb1 values('2010-07-23 11:01:02.000', 'xxxx') insert into tb1 values('2010-07-23 11:01:02.000', 37, 50.1)
insert into tb1 values(now, 'aaaa'); insert into tb1 values(now, 36, 47.8);
insert into tb1 values(now+1a, 'bbbb'); insert into tb1 values(now+1a, 38, 65.3);
insert into tb1 values(now+1s, 'cccc'); insert into tb1 values(now+1s, 38, 53.9 );
insert into tb1 values(now+1m, 'dddd'); insert into tb1 values(now+1m, 37, 45.6);
insert into tb1 values(now+1h, 'eeee'); insert into tb1 values(now+1h, 35, 41.1);
insert into tb1 values(now+1d, 'ffff');
insert into tb1 values(now+1w, 'gggg');
insert into tb1 values(now+1n, 'hhhh');
insert into tb1 values(now+1y, 'iiii');