|
44
|
+1、创建关于统计的超级表:create table liqun_nuode_1_1.superrealtj (ts timestamp, aal float, aam float, aah float, avl float, avm float, avh float, awl float, awm float, awh float, atl float, atm float, ath float, aldl float, aldm float, aldh float, bal float, bam float, bah float, bvl float, bvm float, bvh float, bwl float, bwm float, bwh float, btl float, btm float, bth float, bldl float, bldm float, bldh float, cal float, cam float, cah float, cvl float, cvm float, cvh float, cwl float, cwm float, cwh float, ctl float, ctm float, cth float, cldl float, cldm float, cldh float, nal float, nam float, nah float, ntl float, ntm float, nth float, nldl float, nldm float, nldh float) tags (mac binary(20), addr binary(5))
|
|
46
|
+2、定义把实时查询数据放入统计子表,并创建子表:create table liqun_nuode_1_1.realtj using liqun_nuode_1_1.superrealtj tags ('187ED5316058','1') as select MIN(aa), AVG(aa), MAX(aa), MIN(av), AVG(av), MAX(av), MIN(aw), AVG(aw), MAX(aw), MIN(at), AVG(at), MAX(at), MIN(ald) AVG(ald), MAX(ald), MIN(ba), AVG(ba), MAX(ba), MIN(bv), AVG(bv), MAX(bv), MIN(bw), AVG(bw), MAX(bw), MIN(bt), AVG(bt), MAX(bt), MIN(bld), AVG(bld), MAX(bld), MIN(ca), AVG(ca), MAX(ca), MIN(cv), AVG(cv), MAX(cv), MIN(cw), AVG(cw), MAX(cw), MIN(ct), AVG(ct), MAX(ct), MIN(cld), AVG(cld), MAX(cld), MIN(na), AVG(na), MAX(na), MIN(nt), AVG(nt), MAX(nt), MIN(nld), AVG(nld), MAX(nld) from liqun_nuode_1_1.superreal where mac='187ED5316058' and addr='1' INTERVAL(1M)
|