printf("failed to create super table meters, reason:%s\n",taos_errstr(pRes));
return-1;
}
taos_free_result(pRes);
pRes=taos_query(pConn,"create table d0 using meters tags(1, 'San Francisco')");
if(taos_errno(pRes)!=0){
printf("failed to create child table d0, reason:%s\n",taos_errstr(pRes));
return-1;
}
taos_free_result(pRes);
pRes=taos_query(pConn,"create table d1 using meters tags(2, 'Beijing')");
if(taos_errno(pRes)!=0){
printf("failed to create child table d1, reason:%s\n",taos_errstr(pRes));
return-1;
}
taos_free_result(pRes);
pRes=taos_query(pConn,"create stream meters_summary_s into meters_summary as select _wstart, max(current) as current, groupid, location from meters partition by groupid, location interval(10m)");
if(taos_errno(pRes)!=0){
printf("failed to create super table meters_summary, reason:%s\n",taos_errstr(pRes));
return-1;
}
taos_free_result(pRes);
pRes=taos_query(pConn,"insert into d0 (ts, current) values (now, 120)");
if(taos_errno(pRes)!=0){
printf("failed to insert into table d0, reason:%s\n",taos_errstr(pRes));