print ====> select count(*) from dev_001 session(ts,1d)
#
sql select count(*) from dev_001 session(ts,1d)
# # session with where main
if $rows != 4 then
#
return -1
# tdSql.query("select count(*),first(tagtype),last(tagtype),avg(tagtype),sum(tagtype),min(tagtype),max(tagtype),leastsquares(tagtype, 1, 1) from (select * from dev_001 where ts <'2020-05-20 0:0:0') session(ts,1d)")
endi
#
if $data01 != 13 then
# tdSql.checkRows(2)
return -1
# tdSql.checkData(0, 1, 13)
endi
# tdSql.checkData(0, 2, 1)
# tdSql.checkData(0, 3, 13)
print ====> select count(*) from (select * from dev_001) session(ts,1d)
# tdSql.checkData(0, 4, 7)
sql select count(*) from (select * from dev_001) session(ts,1d)
if $data08 != @{slop:1.000000, intercept:0.000000}@ then
# goto check_dnode_ready_0
return -1
# endi
endi
#
if $data09 != 12 then
# $loop_test = 1
return -1
# goto loop_test_pos
endi
#endi
# $data0-10 != 3.741657387
#
# $data0-11 != 1
# $data1-11 != 14
print ====> select count(*),first(tagtype),last(tagtype),avg(tagtype),sum(tagtype),min(tagtype),max(tagtype),leastsquares(tagtype, 1, 1) from (select * from dev_001 where ts <'2020-05-20 0:0:0') session(ts,1d)
sql select count(*),first(tagtype),last(tagtype),avg(tagtype),sum(tagtype),min(tagtype),max(tagtype),leastsquares(tagtype, 1, 1) from (select * from dev_001 where ts <'2020-05-20 0:0:0') session(ts,1d)
if $rows != 2 then
return -1
endi
if $data01 != 13 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data03 != 13 then
return -1
endi
if $data04 != 7 then
return -1
endi
if $data05 != 91 then
return -1
endi
if $data06 != 1 then
return -1
endi
if $data07 != 13 then
return -1
endi
if $data08 != @{slop:1.000000, intercept:0.000000}@ then
return -1
endi
sql_error select * from dev_001 session(ts,1w)
sql_error select count(*) from st session(ts,1w)
sql_error select count(*) from dev_001 group by tagtype session(ts,1w)
sql_error select count(*) from dev_001 session(ts,1n)
sql_error select count(*) from dev_001 session(ts,1y)
sql_error select count(*) from dev_001 session(ts,0s)
sql_error select count(*) from dev_001 session(i,1y)
sql_error select count(*) from dev_001 session(ts,1d) where ts <'2020-05-20 0:0:0'