sql connect sql use test0; ##### conditions sql use test0; #full join sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts; if $rows != 12 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts or a.ts != b.ts; if $rows != 64 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on timetruncate(a.ts, 1d) = timetruncate(b.ts, 1h); if $rows != 16 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 where a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 or a.col1 = b.col1 where a.ts = b.ts; sql_error select count(*),last(a.col1) from sta a full join sta b on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 where a.ts = b.ts and a.col1 > 2; sql_error select first(b.col1),count(b.t1),last(a.col1) from sta a full join sta b on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null where a.ts = b.ts and b.col1 > 3 and a.t1 != 1; sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; if $rows != 14 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 14 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; if $rows != 15 then return -1 endi sql select a.tbname from sta a full join sta b on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; if $rows != 15 then return -1 endi sql_error select a.tbname from sta a full join sta b on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; if $rows != 13 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 11 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; if $rows != 16 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); if $rows != 10 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; sql_error select a.tbname from sta a full join sta b where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; sql_error select a.tbname from sta a full join sta b where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta a full join sta b where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); #right join sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts; if $rows != 12 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts or a.ts != b.ts; if $rows != 64 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on timetruncate(a.ts, 1d) = timetruncate(b.ts, 1h); if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 where a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 or a.col1 = b.col1 where a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select count(*),last(a.col1) from sta b right join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 where a.ts = b.ts and a.col1 > 2; sql select count(*),last(a.col1) from sta b right join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 and a.ts = b.ts and a.col1 > 2; if $rows != 1 then return -1 endi if $data00 != 9 then return -1 endi if $data01 != 7 then return -1 endi sql_error select first(b.col1),count(b.t1),last(a.col1) from sta b right join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null where a.ts = b.ts and b.col1 > 3 and a.t1 != 1; sql select first(b.col1),count(b.t1),last(a.col1),count(*) from sta b right join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null and a.ts = b.ts and b.col1 > 3 and a.t1 != 1; if $rows != 1 then return -1 endi if $data00 != 5 then return -1 endi if $data01 != 2 then return -1 endi if $data02 != 7 then return -1 endi if $data03 != 8 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; if $rows != 8 then return -1 endi sql select count(b.ts) from sta b right join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; if $rows != 1 then return -1 endi if $data00 != 8 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 8 then return -1 endi sql select count(b.col1) from sta b right join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 1 then return -1 endi if $data00 != 2 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; if $rows != 8 then return -1 endi sql select count(b.ts) from sta b right join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; if $rows != 1 then return -1 endi if $data00 != 4 then return -1 endi sql select a.tbname from sta b right join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; if $rows != 8 then return -1 endi sql select count(b.*) from sta b right join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; if $rows != 1 then return -1 endi if $data00 != 1 then return -1 endi sql_error select a.tbname from sta b right join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; if $rows != 8 then return -1 endi sql select count(b.ts) from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; if $rows != 1 then return -1 endi if $data00 != 3 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 8 then return -1 endi sql select count(b.col1) from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 1 then return -1 endi if $data00 != 5 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; if $rows != 8 then return -1 endi sql select count(b.col1) from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); if $rows != 8 then return -1 endi sql select count(b.ts) from sta b right join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); if $rows != 1 then return -1 endi if $data00 != 6 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; sql_error select a.tbname from sta b right join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; sql_error select a.tbname from sta b right join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); #right semi join sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts; if $rows != 2 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts or a.ts != b.ts; if $rows != 8 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on timetruncate(a.ts, 1d) = timetruncate(b.ts, 1h); if $rows != 0 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 where a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 or a.col1 = b.col1 where a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select count(*),last(a.col1) from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 where a.ts = b.ts and a.col1 > 2; sql select count(*),last(a.col1) from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 and a.ts = b.ts and a.col1 > 2; if $rows != 1 then return -1 endi if $data00 != 6 then return -1 endi if $data01 != 7 then return -1 endi sql_error select first(b.col1),count(b.t1),last(a.col1) from sta b right semi join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null where a.ts = b.ts and b.col1 > 3 and a.t1 != 1; sql select first(b.col1),count(b.t1),last(a.col1),count(*) from sta b right semi join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null and a.ts = b.ts and b.col1 > 3 and a.t1 != 1; if $rows != 1 then return -1 endi if $data00 != 5 then return -1 endi if $data01 != 2 then return -1 endi if $data02 != 7 then return -1 endi if $data03 != 2 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; if $rows != 8 then return -1 endi sql select count(b.ts) from sta b right semi join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; if $rows != 1 then return -1 endi if $data00 != 8 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 2 then return -1 endi sql select count(b.col1) from sta b right semi join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 1 then return -1 endi if $data00 != 2 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; if $rows != 4 then return -1 endi sql select count(b.ts) from sta b right semi join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; if $rows != 1 then return -1 endi if $data00 != 4 then return -1 endi sql select a.tbname from sta b right semi join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; if $rows != 1 then return -1 endi sql select count(b.*) from sta b right semi join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; if $rows != 1 then return -1 endi if $data00 != 1 then return -1 endi sql_error select a.tbname from sta b right semi join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; if $rows != 3 then return -1 endi sql select count(b.ts) from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; if $rows != 1 then return -1 endi if $data00 != 3 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 5 then return -1 endi sql select count(b.col1) from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 1 then return -1 endi if $data00 != 5 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; if $rows != 0 then return -1 endi sql select count(b.col1) from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); if $rows != 6 then return -1 endi sql select count(b.ts) from sta b right semi join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); if $rows != 1 then return -1 endi if $data00 != 6 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; sql_error select a.tbname from sta b right semi join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; sql_error select a.tbname from sta b right semi join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right semi join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); #right anti join sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts; if $rows != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts or a.ts != b.ts; if $rows != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on timetruncate(a.ts, 1d) = timetruncate(b.ts, 1h); if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 where a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts; if $rows != 0 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 or a.col1 = b.col1 where a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; if $rows != 0 then return -1 endi sql_error select count(*),last(a.col1) from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 where a.ts = b.ts and a.col1 > 2; sql select count(*),count(a.col1) from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 and a.ts = b.ts and a.col1 > 2; if $rows != 1 then return -1 endi if $data00 != 2 then return -1 endi if $data01 != 2 then return -1 endi sql_error select first(b.col1),count(b.t1),last(a.col1) from sta b right anti join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null where a.ts = b.ts and b.col1 > 3 and a.t1 != 1; sql select first(b.col1),count(b.t1),last(a.col1),count(*) from sta b right anti join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null and a.ts = b.ts and b.col1 > 3 and a.t1 != 1; if $rows != 1 then return -1 endi if $data00 != NULL then return -1 endi if $data01 != 0 then return -1 endi if $data02 != 5 then return -1 endi if $data03 != 6 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; if $rows != 0 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; if $rows != 0 then return -1 endi sql select count(b.ts) from sta b right anti join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 6 then return -1 endi sql select count(b.col1) from sta b right anti join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; if $rows != 4 then return -1 endi sql select count(b.ts) from sta b right anti join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.tbname from sta b right anti join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; if $rows != 7 then return -1 endi sql select count(b.*) from sta b right anti join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql_error select a.tbname from sta b right anti join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; if $rows != 5 then return -1 endi sql select count(b.ts) from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 3 then return -1 endi sql select count(b.col1) from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; if $rows != 8 then return -1 endi sql select count(b.col1) from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); if $rows != 2 then return -1 endi sql select count(b.ts) from sta b right anti join sta a on a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; sql_error select a.tbname from sta b right anti join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; sql_error select a.tbname from sta b right anti join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right anti join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); #right asof join sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts; if $rows != 2 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) where a.ts = b.ts or a.ts != b.ts; if $rows != 8 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on timetruncate(a.ts, 1d) = timetruncate(b.ts, 1h); if $rows != 8 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 where a.ts = b.ts; if $rows != 8 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 or a.col1 = b.col1 where a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.ts >= b.ts and a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql_error select count(*),last(a.col1) from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 where a.ts = b.ts and a.col1 > 2; sql_error select count(*),count(a.col1) from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 and a.ts = b.ts and a.col1 > 2; sql_error select first(b.col1),count(b.t1),last(a.col1) from sta b right asof join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null where a.ts = b.ts and b.col1 > 3 and a.t1 != 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql_error select count(b.ts) from sta b right asof join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 8 then return -1 endi sql select count(b.col1) from sta b right asof join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; if $rows != 1 then return -1 endi if $data00 != 2 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts where b.col1 > 1 or a.col1 > 2; if $rows != 7 then return -1 endi sql_error select a.tbname from sta b right asof join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; sql select a.tbname from sta b right asof join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts where a.col1 = b.col1 + 1; sql_error select a.tbname from sta b right asof join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and a.ts = b.ts where a.col1 > 2 and b.col1 < 5; if $rows != 3 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and a.ts = b.ts where (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 5 then return -1 endi sql select count(b.col1) from sta b right asof join sta a on a.t1 = b.t1 and a.ts = b.ts where (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 1 then return -1 endi if $data00 != 5 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a on a.t1 = b.t1 and a.ts = b.ts where (a.col1 < 3 or b.col1 > 3); if $rows != 6 then return -1 endi sql select count(b.ts) from sta b right asof join sta a on a.t1 = b.t1 and a.ts = b.ts where (a.col1 < 3 or b.col1 > 3); if $rows != 1 then return -1 endi if $data00 != 6 then return -1 endi sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; sql select a.tbname from sta b right asof join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; sql_error select a.tbname from sta b right asof join sta a where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; sql select a.ts, a.col1, b.ts, b.col1 from sta b right asof join sta a where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); #right window join sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on timetruncate(a.ts, 1h) = timetruncate(b.ts, 1h) window_offset(-1s, 1s) where a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on timetruncate(a.ts, 1d) = timetruncate(b.ts, 1h) window_offset(-1s, 1s); sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.ts = b.ts; if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 and a.ts = b.ts window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 or a.col1 = b.col1 window_offset(-1s, 1s) where a.ts = b.ts; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.ts >= b.ts and a.ts = b.ts window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts window_offset(-1s, 1s); sql_error select count(*),last(a.col1) from sta b right window join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 window_offset(-1s, 1s) where a.ts = b.ts and a.col1 > 2; sql_error select count(*),count(a.col1) from sta b right window join sta a on (a.t1 = b.t1 or a.col1 > b.col1) and a.col1 > 1 and a.ts = b.ts and a.col1 > 2 window_offset(-1s, 1s); sql_error select first(b.col1),count(b.t1),last(a.col1) from sta b right window join sta a on a.t1 = b.t1 and a.col1 > 1 and b.t1 is not null window_offset(-1s, 1s) where a.ts = b.ts and b.col1 > 3 and a.t1 != 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts) window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts window_offset(-1s, 1s); sql_error select count(b.ts) from sta b right window join sta a on (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 window_offset(-1s, 1s); sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 and a.col1 = b.col1 window_offset(-1s, 1s); if $rows != 8 then return -1 endi sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 and b.col1 > 1 window_offset(-1s, 1s); sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.col1 > 1 or a.col1 > 2; if $rows != 13 then return -1 endi sql_error select a.tbname from sta b right window join sta a on a.t1 = b.t1 and a.col1 = b.col1 + 1 window_offset(-1s, 1s); sql_error select a.tbname from sta b right window join sta a on a.t1 = b.t1 and count(a.col1) = 1; sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5 window_offset(-1s, 1s); sql_error select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 and a.ts = b.ts window_offset(-1s, 1s) where a.col1 > 2 and b.col1 < 5; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; if $rows != 7 then return -1 endi sql select a.ts from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where (a.col1 < 3 or a.col1 > 4) and b.col1 is not null having(count(a.ts) > 0); sql select a.ts from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.col1 < 3 or a.col1 > 4 having(count(a.ts) > 1); if $rows != 2 then return -1 endi if $data00 != @23-11-17 16:29:00.000@ then return -1 endi if $data10 != @23-11-17 16:29:04.000@ then return -1 endi sql_error select a.ts from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.col1 < 3 or a.col1 > 4 having(count(a.ts) > 1) order by b.col1; sql_error select a.ts from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.col1 < 3 or a.col1 > 4 having(count(a.ts) > 1) order by b.tbname; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; sql select count(b.col1),a.t1,a.ts from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.col1 < 3 or a.col1 > 4 order by 2,3; if $rows != 5 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != 2 then return -1 endi if $data20 != 2 then return -1 endi if $data30 != 1 then return -1 endi if $data40 != 1 then return -1 endi sql_error select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.col1 < 3 or a.col1 > 4 order by b.col1; sql select count(b.col1) c from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.col1 < 3 or a.col1 > 4 order by a.col1, c; if $rows != 5 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != 2 then return -1 endi if $data20 != 1 then return -1 endi if $data30 != 2 then return -1 endi if $data40 != 1 then return -1 endi sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.ts > 0 and b.col1 is not null; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.ts > 0; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.tbname > 'a'; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.t1 > 1; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.col1 > 1; sql select count(b.col1) from sta b right window join sta a on a.col1 = b.col1 window_offset(-1s, 1s) where b.col1 > 1; sql select count(b.col1) from tba1 b right window join sta a window_offset(-1s, 1s) where b.tbname > 'a'; sql select count(b.col1) from tba1 b right window join sta a window_offset(-1s, 1s) where b.t1 > 1; sql select count(b.col1) from tba1 b right window join sta a window_offset(-1s, 1s) where b.col1 > 1; sql select count(b.col1) from tba1 b right window join sta a on a.col1 = b.col1 window_offset(-1s, 1s) where b.col1 > 1; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.tbname > 'tba1'; if $rows != 4 then return -1 endi if $data00 != 2 then return -1 endi if $data10 != 2 then return -1 endi if $data20 != 1 then return -1 endi if $data30 != 1 then return -1 endi sql select count(b.col1) from tba2 b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.tbname < 'tba2'; if $rows != 1 then return -1 endi if $data00 != 0 then return -1 endi sql select count(b.col1) from tba2 b right window join sta a window_offset(-1s, 1s) where b.tbname < 'tba2'; sql select count(b.col1) from tba2 b right window join sta a window_offset(-1s, 1s) where b.t1 < 2; sql select count(b.col1) from tba2 b right window join sta a window_offset(-1s, 1s) where b.col1 < 1; sql_error select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) order by b.tbname; sql_error select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) order by b.col1; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) order by b.t1; sql_error select count(b.col1) from sta b right window join sta a window_offset(-1s, 1s) order by b.t1; sql select count(b.col1) from tba1 b right window join sta a window_offset(-1s, 1s) order by b.tbname; sql_error select count(b.col1) from tba1 b right window join sta a window_offset(-1s, 1s) order by b.col1; sql select count(b.col1) from tba1 b right window join sta a window_offset(-1s, 1s) order by b.t1; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) order by a.tbname, a.ts; if $rows != 8 then return -1 endi if $data00 != 1 then return -1 endi if $data10 != 2 then return -1 endi if $data20 != 3 then return -1 endi if $data30 != 2 then return -1 endi if $data40 != 2 then return -1 endi if $data50 != 2 then return -1 endi if $data60 != 1 then return -1 endi if $data70 != 1 then return -1 endi sql select count(b.col1) from tba2 b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) order by b.tbname, a.ts; if $rows != 8 then return -1 endi if $data00 != 0 then return -1 endi if $data10 != 0 then return -1 endi if $data20 != 0 then return -1 endi if $data30 != 0 then return -1 endi if $data40 != 2 then return -1 endi if $data50 != 2 then return -1 endi if $data60 != 1 then return -1 endi if $data70 != 1 then return -1 endi sql_error select count(b.col1), b.tbname from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s); sql select count(b.col1), a.tbname from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s); sql select count(b.col1), b.tbname from tba2 b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s); sql select first(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.ts > 0; sql select first(a.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where b.ts > 0; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.ts > 0; sql select count(b.col1) from sta b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) where a.col1 > 0; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where (a.t1 = b.t1 or a.col1 = b.col1) and a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where (a.t1 = b.t1 or a.col1 = b.col1) or a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where (a.t1 = b.t1 or a.col1 = b.col1) and (timetruncate(a.ts, 1h) = b.ts or a.ts = b.ts); sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where (a.t1 = b.t1 or a.col1 = b.col1) and timetruncate(a.ts, 1m) = b.ts; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and b.col1 > 1; sql select a.tbname from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and a.col1 = b.col1 + 1; sql_error select a.tbname from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and timetruncate(a.ts, 1m) = b.ts and count(a.col1) = 1; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and a.ts = b.ts and a.col1 > 2 and b.col1 < 5; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is not null; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or a.col1 > 4) and b.col1 is null; sql select a.ts, a.col1, b.ts, b.col1 from sta b right window join sta a window_offset(-1s, 1s) where a.t1 = b.t1 and a.ts = b.ts and (a.col1 < 3 or b.col1 > 3); sql_error select distinct count(b.col1) from tba2 b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) order by b.tbname, a.ts; sql select distinct count(b.col1) c from tba2 b right window join sta a on a.t1 = b.t1 window_offset(-1s, 1s) order by c; if $rows != 3 then return -1 endi if $data00 != 0 then return -1 endi if $data10 != 1 then return -1 endi if $data20 != 2 then return -1 endi