fix: add more test cases

This commit is contained in:
dapan1121 2025-03-11 19:26:45 +08:00
parent a4ed19b36d
commit ad4b278162
10 changed files with 3425 additions and 16 deletions

View File

@ -0,0 +1,763 @@
taos> use test;
Database changed.
taos> select * from a1 a full join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select * from a1 a full join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts1 | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a full join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.* from a1 a full join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select a.*, b.ts from a1 a full join (select today as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts |
================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:01.000 |
__today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:00.000 |
__today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:02.000 |
__today__ 00:00:01.000 | 102 | 1012 | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
taos> select b.c from a1 a full join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select b.ts from a1 a full join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
NULL |
NULL |
NULL |
taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g | ts1 | ts | f | g | c |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts1 | ts | f | g | c |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.ts1,a.ts from a1 a full join (select today as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
ts1 | ts |
====================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
NULL | __today__ 00:00:01.000 |
NULL | __tomorrow__ 00:00:00.000 |
NULL | __tomorrow__ 00:00:02.000 |
taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
NULL | NULL | NULL |
taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
NU. |
a |
NU. |
a |
NU. |
a |
taos> select b.ts from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
NULL | NULL | NULL |
taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
NU. |
a |
NU. |
a |
NU. |
a |
taos> select b.ts from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
__tomorrow__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
NULL |
NULL |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
__tomorrow__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
NULL |
NULL |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a full join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta full join (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 1 |
__tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
NULL | NULL | NULL | __today__ 00:00:00.000 | 304 | 1 |
NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 2 |
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
__today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
__today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 304 | 1 |
taos> select * from (select today as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select * from (select today as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.* from (select today as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.c from (select today as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select b.ts from (select today as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
NULL |
NULL |
NULL |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select b.ts1 from (select today as ts1, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
ts1 |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
NULL |
NULL |
NULL |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
a |
NU. |
a |
NU. |
a |
NU. |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
NULL |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
a |
NU. |
a |
NU. |
a |
NU. |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
NULL |
taos> select * from (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
__today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 1 |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
__today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
NULL | NULL | NULL | __today__ 00:00:01.000 | 102 | 1 |
NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 103 | 1 |
NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
NULL | NULL | NULL | __today__ 00:00:01.000 | 202 | 2 |
NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 203 | 2 |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
1 taos> use test;
2 Database changed.
3 taos> select * from a1 a full join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
4 ts | f | g | ts | f | g | 'a' |
5 ==================================================================================================================
6 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
7 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
8 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
9 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
10 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
11 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
12 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
13 taos> select * from a1 a full join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
14 ts | f | g | ts1 | f | g | 'a' |
15 ==================================================================================================================
16 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
17 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
18 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
19 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
20 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
21 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
22 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
23 taos> select a.* from a1 a full join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
24 ts | f | g |
25 ======================================================
26 __today__ 00:00:00.000 | 101 | 1011 |
27 __today__ 00:00:00.000 | 101 | 1011 |
28 __today__ 00:00:00.000 | 101 | 1011 |
29 __today__ 00:00:00.000 | 101 | 1011 |
30 __today__ 00:00:01.000 | 102 | 1012 |
31 __tomorrow__ 00:00:00.000 | 103 | 1013 |
32 __tomorrow__ 00:00:02.000 | 104 | 1014 |
33 taos> select b.* from a1 a full join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
34 ts | f | g | 'a' |
35 ============================================================
36 __today__ 00:00:00.000 | 301 | 3011 | a |
37 __today__ 00:00:00.000 | 302 | 3012 | a |
38 __today__ 00:00:00.000 | 303 | 3013 | a |
39 __today__ 00:00:00.000 | 304 | 3014 | a |
40 NULL | NULL | NULL | NU. |
41 NULL | NULL | NULL | NU. |
42 NULL | NULL | NULL | NU. |
43 taos> select b.* from a1 a full join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
44 ts1 | f | g | 'a' |
45 ============================================================
46 __today__ 00:00:00.000 | 301 | 3011 | a |
47 __today__ 00:00:00.000 | 302 | 3012 | a |
48 __today__ 00:00:00.000 | 303 | 3013 | a |
49 __today__ 00:00:00.000 | 304 | 3014 | a |
50 NULL | NULL | NULL | NU. |
51 NULL | NULL | NULL | NU. |
52 NULL | NULL | NULL | NU. |
53 taos> select a.*, b.ts from a1 a full join (select today as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
54 ts | f | g | ts |
55 ================================================================================
56 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
57 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:01.000 |
58 __today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:00.000 |
59 __today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:02.000 |
60 __today__ 00:00:01.000 | 102 | 1012 | NULL |
61 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
62 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
63 taos> select b.c from a1 a full join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
64 c |
65 ======
66 a |
67 a |
68 a |
69 a |
70 NU. |
71 NU. |
72 NU. |
73 taos> select b.ts from a1 a full join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
74 ts |
75 ==========================
76 __today__ 00:00:00.000 |
77 __today__ 00:00:00.000 |
78 __today__ 00:00:00.000 |
79 __today__ 00:00:00.000 |
80 NULL |
81 NULL |
82 NULL |
83 taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
84 ts | f | g | ts1 | ts | f | g | 'a' |
85 ============================================================================================================================================
86 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
87 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
88 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
89 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
90 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
91 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
92 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
93 taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
94 ts | f | g |
95 ======================================================
96 __today__ 00:00:00.000 | 101 | 1011 |
97 __today__ 00:00:00.000 | 101 | 1011 |
98 __today__ 00:00:00.000 | 101 | 1011 |
99 __today__ 00:00:00.000 | 101 | 1011 |
100 __today__ 00:00:01.000 | 102 | 1012 |
101 __tomorrow__ 00:00:00.000 | 103 | 1013 |
102 __tomorrow__ 00:00:02.000 | 104 | 1014 |
103 taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
104 ts1 | ts | f | g | 'a' |
105 ======================================================================================
106 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
107 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
108 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
109 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
110 NULL | NULL | NULL | NULL | NU. |
111 NULL | NULL | NULL | NULL | NU. |
112 NULL | NULL | NULL | NULL | NU. |
113 taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
114 c |
115 ======
116 a |
117 a |
118 a |
119 a |
120 NU. |
121 NU. |
122 NU. |
123 taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
124 ts | f | g | ts1 | ts | f | g | c |
125 ============================================================================================================================================
126 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
127 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
128 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
129 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
130 taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
131 ts | f | g |
132 ======================================================
133 __today__ 00:00:00.000 | 101 | 1011 |
134 __today__ 00:00:01.000 | 102 | 1012 |
135 __tomorrow__ 00:00:00.000 | 103 | 1013 |
136 __tomorrow__ 00:00:02.000 | 104 | 1014 |
137 taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
138 ts1 | ts | f | g | c |
139 ======================================================================================
140 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
141 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
142 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
143 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
144 taos> select b.ts1,a.ts from a1 a full join (select today as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
145 ts1 | ts |
146 ====================================================
147 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
148 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
149 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
150 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
151 NULL | __today__ 00:00:01.000 |
152 NULL | __tomorrow__ 00:00:00.000 |
153 NULL | __tomorrow__ 00:00:02.000 |
154 taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
155 ts | f | g | ts1 | ts | f | g | 'a' |
156 ============================================================================================================================================
157 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
158 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
159 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
160 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
161 taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
162 ts | f | g |
163 ======================================================
164 __today__ 00:00:00.000 | 101 | 1011 |
165 __today__ 00:00:01.000 | 102 | 1012 |
166 __tomorrow__ 00:00:00.000 | 103 | 1013 |
167 __tomorrow__ 00:00:02.000 | 104 | 1014 |
168 taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
169 ts1 | ts | f | g | 'a' |
170 ======================================================================================
171 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
172 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
173 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
174 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
175 taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
176 c |
177 ======
178 a |
179 a |
180 a |
181 a |
182 taos> select b.ts from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
183 ts |
184 ==========================
185 __today__ 00:00:00.000 |
186 __today__ 00:00:01.000 |
187 __tomorrow__ 00:00:00.000 |
188 __tomorrow__ 00:00:02.000 |
189 taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
190 ts | f | g | ts1 | ts | f | g | 'a' |
191 ============================================================================================================================================
192 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
193 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
194 NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
195 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
196 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
197 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
198 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
199 taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
200 ts | f | g |
201 ======================================================
202 __today__ 00:00:00.000 | 101 | 1011 |
203 __today__ 00:00:01.000 | 102 | 1012 |
204 NULL | NULL | NULL |
205 __tomorrow__ 00:00:00.000 | 103 | 1013 |
206 NULL | NULL | NULL |
207 __tomorrow__ 00:00:02.000 | 104 | 1014 |
208 NULL | NULL | NULL |
209 taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
210 ts1 | ts | f | g | 'a' |
211 ======================================================================================
212 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
213 NULL | NULL | NULL | NULL | NU. |
214 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
215 NULL | NULL | NULL | NULL | NU. |
216 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
217 NULL | NULL | NULL | NULL | NU. |
218 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
219 taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
220 c |
221 ======
222 a |
223 NU. |
224 a |
225 NU. |
226 a |
227 NU. |
228 a |
229 taos> select b.ts from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
230 ts |
231 ==========================
232 __today__ 00:00:00.000 |
233 NULL |
234 __today__ 00:00:01.000 |
235 NULL |
236 __tomorrow__ 00:00:00.000 |
237 NULL |
238 __tomorrow__ 00:00:02.000 |
239 taos> select * from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
240 ts | f | g | ts1 | ts | f | g | 'a' |
241 ============================================================================================================================================
242 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
243 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
244 NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
245 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
246 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
247 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
248 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
249 taos> select a.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
250 ts | f | g |
251 ======================================================
252 __today__ 00:00:00.000 | 101 | 1011 |
253 __today__ 00:00:01.000 | 102 | 1012 |
254 NULL | NULL | NULL |
255 __tomorrow__ 00:00:00.000 | 103 | 1013 |
256 NULL | NULL | NULL |
257 __tomorrow__ 00:00:02.000 | 104 | 1014 |
258 NULL | NULL | NULL |
259 taos> select b.* from a1 a full join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
260 ts1 | ts | f | g | 'a' |
261 ======================================================================================
262 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
263 NULL | NULL | NULL | NULL | NU. |
264 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
265 NULL | NULL | NULL | NULL | NU. |
266 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
267 NULL | NULL | NULL | NULL | NU. |
268 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
269 taos> select b.c from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
270 c |
271 ======
272 a |
273 NU. |
274 a |
275 NU. |
276 a |
277 NU. |
278 a |
279 taos> select b.ts from a1 a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
280 ts |
281 ==========================
282 __today__ 00:00:00.000 |
283 NULL |
284 __today__ 00:00:01.000 |
285 NULL |
286 __tomorrow__ 00:00:00.000 |
287 NULL |
288 __tomorrow__ 00:00:02.000 |
289 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
290 ts |
291 ==========================
292 __today__ 00:00:00.000 |
293 NULL |
294 __today__ 00:00:01.000 |
295 NULL |
296 __tomorrow__ 00:00:00.000 |
297 NULL |
298 __tomorrow__ 00:00:02.000 |
299 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
300 ts |
301 ==========================
302 __today__ 00:00:00.000 |
303 __today__ 00:00:01.000 |
304 __tomorrow__ 00:00:00.000 |
305 __tomorrow__ 00:00:02.000 |
306 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
307 ts |
308 ==========================
309 __today__ 00:00:00.000 |
310 __tomorrow__ 00:00:02.000 |
311 __tomorrow__ 00:00:00.000 |
312 __today__ 00:00:01.000 |
313 NULL |
314 NULL |
315 NULL |
316 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
317 ts |
318 ==========================
319 __today__ 00:00:00.000 |
320 __today__ 00:00:01.000 |
321 __tomorrow__ 00:00:00.000 |
322 __tomorrow__ 00:00:02.000 |
323 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
324 ts |
325 ==========================
326 __today__ 00:00:00.000 |
327 __tomorrow__ 00:00:02.000 |
328 __tomorrow__ 00:00:00.000 |
329 __today__ 00:00:01.000 |
330 NULL |
331 NULL |
332 NULL |
333 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a full join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
334 ts |
335 ==========================
336 NULL |
337 __today__ 00:00:00.000 |
338 NULL |
339 __today__ 00:00:01.000 |
340 NULL |
341 __tomorrow__ 00:00:00.000 |
342 NULL |
343 __tomorrow__ 00:00:02.000 |
344 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta full join (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
345 ts | val | tg1 | ts | val | tg1 |
346 ============================================================================================================
347 NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 1 |
348 __tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
349 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
350 ts | val | tg2 | ts | val | tg2 |
351 ============================================================================================================
352 NULL | NULL | NULL | __today__ 00:00:00.000 | 304 | 1 |
353 NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 2 |
354 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
355 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
356 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
357 ts | val | tg2 | ts | val | tg2 |
358 ============================================================================================================
359 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
360 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
361 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
362 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
363 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
364 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
365 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
366 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
367 __today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
368 __today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
369 __tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
370 __tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
371 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
372 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
373 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
374 ts | val | tg2 | ts | val | tg2 |
375 ============================================================================================================
376 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
377 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
378 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
379 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
380 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
381 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
382 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
383 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
384 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
385 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
386 ts | val | tg2 | ts | val | tg2 |
387 ============================================================================================================
388 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
389 __tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
390 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 304 | 1 |
391 taos> select * from (select today as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
392 ts | f | g | 'a' | ts | f | g |
393 ==================================================================================================================
394 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
395 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
396 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
397 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
398 NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
399 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
400 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
401 taos> select * from (select today as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
402 ts1 | f | g | 'a' | ts | f | g |
403 ==================================================================================================================
404 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
405 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
406 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
407 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
408 NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
409 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
410 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
411 taos> select a.* from (select today as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
412 ts | f | g |
413 ======================================================
414 __today__ 00:00:00.000 | 101 | 1011 |
415 __today__ 00:00:00.000 | 101 | 1011 |
416 __today__ 00:00:00.000 | 101 | 1011 |
417 __today__ 00:00:00.000 | 101 | 1011 |
418 __today__ 00:00:01.000 | 102 | 1012 |
419 __tomorrow__ 00:00:00.000 | 103 | 1013 |
420 __tomorrow__ 00:00:02.000 | 104 | 1014 |
421 taos> select b.* from (select today as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
422 ts | f | g | 'a' |
423 ============================================================
424 __today__ 00:00:00.000 | 301 | 3011 | a |
425 __today__ 00:00:00.000 | 302 | 3012 | a |
426 __today__ 00:00:00.000 | 303 | 3013 | a |
427 __today__ 00:00:00.000 | 304 | 3014 | a |
428 NULL | NULL | NULL | NU. |
429 NULL | NULL | NULL | NU. |
430 NULL | NULL | NULL | NU. |
431 taos> select b.* from (select today as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
432 ts1 | f | g | 'a' |
433 ============================================================
434 __today__ 00:00:00.000 | 301 | 3011 | a |
435 __today__ 00:00:00.000 | 302 | 3012 | a |
436 __today__ 00:00:00.000 | 303 | 3013 | a |
437 __today__ 00:00:00.000 | 304 | 3014 | a |
438 NULL | NULL | NULL | NU. |
439 NULL | NULL | NULL | NU. |
440 NULL | NULL | NULL | NU. |
441 taos> select b.c from (select today as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
442 c |
443 ======
444 a |
445 a |
446 a |
447 a |
448 NU. |
449 NU. |
450 NU. |
451 taos> select b.ts from (select today as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
452 ts |
453 ==========================
454 __today__ 00:00:00.000 |
455 __today__ 00:00:00.000 |
456 __today__ 00:00:00.000 |
457 __today__ 00:00:00.000 |
458 NULL |
459 NULL |
460 NULL |
461 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
462 ts1 | ts | f | g | 'a' | ts | f | g |
463 ============================================================================================================================================
464 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
465 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
466 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
467 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
468 NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
469 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
470 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
471 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
472 ts | f | g |
473 ======================================================
474 __today__ 00:00:00.000 | 101 | 1011 |
475 __today__ 00:00:00.000 | 101 | 1011 |
476 __today__ 00:00:00.000 | 101 | 1011 |
477 __today__ 00:00:00.000 | 101 | 1011 |
478 __today__ 00:00:01.000 | 102 | 1012 |
479 __tomorrow__ 00:00:00.000 | 103 | 1013 |
480 __tomorrow__ 00:00:02.000 | 104 | 1014 |
481 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
482 ts1 | ts | f | g | 'a' |
483 ======================================================================================
484 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
485 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
486 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
487 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
488 NULL | NULL | NULL | NULL | NU. |
489 NULL | NULL | NULL | NULL | NU. |
490 NULL | NULL | NULL | NULL | NU. |
491 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
492 c |
493 ======
494 a |
495 a |
496 a |
497 a |
498 NU. |
499 NU. |
500 NU. |
501 taos> select b.ts1 from (select today as ts1, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
502 ts1 |
503 ==========================
504 __today__ 00:00:00.000 |
505 __today__ 00:00:00.000 |
506 __today__ 00:00:00.000 |
507 __today__ 00:00:00.000 |
508 NULL |
509 NULL |
510 NULL |
511 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
512 ts1 | ts | f | g | 'a' | ts | f | g |
513 ============================================================================================================================================
514 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
515 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
516 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
517 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
518 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
519 ts | f | g |
520 ======================================================
521 __today__ 00:00:00.000 | 101 | 1011 |
522 __today__ 00:00:01.000 | 102 | 1012 |
523 __tomorrow__ 00:00:00.000 | 103 | 1013 |
524 __tomorrow__ 00:00:02.000 | 104 | 1014 |
525 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
526 ts1 | ts | f | g | 'a' |
527 ======================================================================================
528 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
529 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
530 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
531 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
532 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
533 c |
534 ======
535 a |
536 a |
537 a |
538 a |
539 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
540 ts |
541 ==========================
542 __today__ 00:00:00.000 |
543 __today__ 00:00:01.000 |
544 __tomorrow__ 00:00:00.000 |
545 __tomorrow__ 00:00:02.000 |
546 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
547 ts1 | ts | f | g | 'a' | ts | f | g |
548 ============================================================================================================================================
549 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
550 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
551 NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
552 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
553 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
554 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
555 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
556 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
557 ts | f | g |
558 ======================================================
559 __today__ 00:00:00.000 | 101 | 1011 |
560 NULL | NULL | NULL |
561 __today__ 00:00:01.000 | 102 | 1012 |
562 NULL | NULL | NULL |
563 __tomorrow__ 00:00:00.000 | 103 | 1013 |
564 NULL | NULL | NULL |
565 __tomorrow__ 00:00:02.000 | 104 | 1014 |
566 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
567 ts1 | ts | f | g | 'a' |
568 ======================================================================================
569 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
570 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
571 NULL | NULL | NULL | NULL | NU. |
572 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
573 NULL | NULL | NULL | NULL | NU. |
574 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
575 NULL | NULL | NULL | NULL | NU. |
576 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
577 c |
578 ======
579 a |
580 a |
581 NU. |
582 a |
583 NU. |
584 a |
585 NU. |
586 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
587 ts |
588 ==========================
589 __today__ 00:00:00.000 |
590 __today__ 00:00:01.000 |
591 NULL |
592 __tomorrow__ 00:00:00.000 |
593 NULL |
594 __tomorrow__ 00:00:02.000 |
595 NULL |
596 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
597 ts1 | ts | f | g | 'a' | ts | f | g |
598 ============================================================================================================================================
599 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
600 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
601 NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
602 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
603 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
604 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
605 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
606 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
607 ts | f | g |
608 ======================================================
609 __today__ 00:00:00.000 | 101 | 1011 |
610 NULL | NULL | NULL |
611 __today__ 00:00:01.000 | 102 | 1012 |
612 NULL | NULL | NULL |
613 __tomorrow__ 00:00:00.000 | 103 | 1013 |
614 NULL | NULL | NULL |
615 __tomorrow__ 00:00:02.000 | 104 | 1014 |
616 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
617 ts1 | ts | f | g | 'a' |
618 ======================================================================================
619 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
620 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
621 NULL | NULL | NULL | NULL | NU. |
622 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
623 NULL | NULL | NULL | NULL | NU. |
624 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
625 NULL | NULL | NULL | NULL | NU. |
626 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
627 c |
628 ======
629 a |
630 a |
631 NU. |
632 a |
633 NU. |
634 a |
635 NU. |
636 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
637 ts |
638 ==========================
639 __today__ 00:00:00.000 |
640 __today__ 00:00:01.000 |
641 NULL |
642 __tomorrow__ 00:00:00.000 |
643 NULL |
644 __tomorrow__ 00:00:02.000 |
645 NULL |
646 taos> select * from (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
647 ts | val | tg1 | ts | val | tg1 |
648 ============================================================================================================
649 __today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
650 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 1 |
651 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
652 ts | val | tg2 | ts | val | tg2 |
653 ============================================================================================================
654 __today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
655 __today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
656 NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
657 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
658 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.val, tb.val;
659 ts | val | tg2 | ts | val | tg2 |
660 ============================================================================================================
661 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
662 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
663 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
664 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
665 NULL | NULL | NULL | __today__ 00:00:01.000 | 102 | 1 |
666 NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 103 | 1 |
667 NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
668 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
669 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
670 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
671 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
672 NULL | NULL | NULL | __today__ 00:00:01.000 | 202 | 2 |
673 NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 203 | 2 |
674 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
675 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
676 ts | val | tg2 | ts | val | tg2 |
677 ============================================================================================================
678 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
679 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
680 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
681 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
682 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
683 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
684 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
685 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
686 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;

View File

@ -0,0 +1,79 @@
use test;
select * from a1 a full join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select * from a1 a full join (select __today__ as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
select a.* from a1 a full join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a full join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a full join (select __today__ as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
select a.*, b.ts from a1 a full join (select __today__ as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
select b.c from a1 a full join (select __today__ as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select b.ts from a1 a full join (select __today__ as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select * from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select a.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select b.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select b.c from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
select * from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select a.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select b.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select b.ts1,a.ts from a1 a full join (select __today__ as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
select * from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select a.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.c from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select b.ts from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select * from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select a.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.c from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.ts from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select * from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select a.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.* from a1 a full join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.c from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from a1 a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a full join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta full join (select __today__ ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=__today__ where tb.ts=__today__ order by tb.val;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>__today__ where tb.ts>__today__;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select __today__ + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select __today__ as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
select a.* from (select __today__ as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
select b.c from (select __today__ as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
select b.ts from (select __today__ as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
select b.ts1 from (select __today__ as ts1, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
select * from (select __today__ ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.val, tb.val;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=__today__ where tb.ts=__today__ order by tb.val;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>__today__ where tb.ts>__today__;

View File

@ -0,0 +1,763 @@
taos> use test;
Database changed.
taos> select * from a1 a full join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select * from a1 a full join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts1 | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a full join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.* from a1 a full join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select a.*, b.ts from a1 a full join (select today() as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts |
================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:01.000 |
__today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:00.000 |
__today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:02.000 |
__today__ 00:00:01.000 | 102 | 1012 | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
taos> select b.c from a1 a full join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select b.ts from a1 a full join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
NULL |
NULL |
NULL |
taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g | ts1 | ts | f | g | c |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts1 | ts | f | g | c |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.ts1,a.ts from a1 a full join (select today() as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
ts1 | ts |
====================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
NULL | __today__ 00:00:01.000 |
NULL | __tomorrow__ 00:00:00.000 |
NULL | __tomorrow__ 00:00:02.000 |
taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
NULL | NULL | NULL |
taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
NU. |
a |
NU. |
a |
NU. |
a |
taos> select b.ts from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
NULL | NULL | NULL |
taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
NU. |
a |
NU. |
a |
NU. |
a |
taos> select b.ts from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
__tomorrow__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
NULL |
NULL |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
__tomorrow__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
NULL |
NULL |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a full join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
__today__ 00:00:00.000 |
NULL |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta full join (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 1 |
__tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
NULL | NULL | NULL | __today__ 00:00:00.000 | 304 | 1 |
NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 2 |
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
__today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
__today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today() + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 304 | 1 |
taos> select * from (select today() as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select * from (select today() as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today() as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today() as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.* from (select today() as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.c from (select today() as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select b.ts from (select today() as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
NULL |
NULL |
NULL |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
c |
======
a |
a |
a |
a |
NU. |
NU. |
NU. |
taos> select b.ts1 from (select today() as ts1, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
ts1 |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
NULL |
NULL |
NULL |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
a |
NU. |
a |
NU. |
a |
NU. |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
NULL |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
NULL | NULL | NULL |
__today__ 00:00:01.000 | 102 | 1012 |
NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
NULL | NULL | NULL | NULL | NU. |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
a |
NU. |
a |
NU. |
a |
NU. |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
NULL |
__tomorrow__ 00:00:00.000 |
NULL |
__tomorrow__ 00:00:02.000 |
NULL |
taos> select * from (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
__today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 1 |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
__today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
NULL | NULL | NULL | __today__ 00:00:01.000 | 102 | 1 |
NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 103 | 1 |
NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
NULL | NULL | NULL | __today__ 00:00:01.000 | 202 | 2 |
NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 203 | 2 |
NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
1 taos> use test;
2 Database changed.
3 taos> select * from a1 a full join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
4 ts | f | g | ts | f | g | 'a' |
5 ==================================================================================================================
6 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
7 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
8 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
9 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
10 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
11 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
12 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
13 taos> select * from a1 a full join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
14 ts | f | g | ts1 | f | g | 'a' |
15 ==================================================================================================================
16 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
17 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 302 | 3012 | a |
18 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 303 | 3013 | a |
19 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 304 | 3014 | a |
20 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
21 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
22 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
23 taos> select a.* from a1 a full join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
24 ts | f | g |
25 ======================================================
26 __today__ 00:00:00.000 | 101 | 1011 |
27 __today__ 00:00:00.000 | 101 | 1011 |
28 __today__ 00:00:00.000 | 101 | 1011 |
29 __today__ 00:00:00.000 | 101 | 1011 |
30 __today__ 00:00:01.000 | 102 | 1012 |
31 __tomorrow__ 00:00:00.000 | 103 | 1013 |
32 __tomorrow__ 00:00:02.000 | 104 | 1014 |
33 taos> select b.* from a1 a full join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
34 ts | f | g | 'a' |
35 ============================================================
36 __today__ 00:00:00.000 | 301 | 3011 | a |
37 __today__ 00:00:00.000 | 302 | 3012 | a |
38 __today__ 00:00:00.000 | 303 | 3013 | a |
39 __today__ 00:00:00.000 | 304 | 3014 | a |
40 NULL | NULL | NULL | NU. |
41 NULL | NULL | NULL | NU. |
42 NULL | NULL | NULL | NU. |
43 taos> select b.* from a1 a full join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
44 ts1 | f | g | 'a' |
45 ============================================================
46 __today__ 00:00:00.000 | 301 | 3011 | a |
47 __today__ 00:00:00.000 | 302 | 3012 | a |
48 __today__ 00:00:00.000 | 303 | 3013 | a |
49 __today__ 00:00:00.000 | 304 | 3014 | a |
50 NULL | NULL | NULL | NU. |
51 NULL | NULL | NULL | NU. |
52 NULL | NULL | NULL | NU. |
53 taos> select a.*, b.ts from a1 a full join (select today() as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
54 ts | f | g | ts |
55 ================================================================================
56 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
57 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:01.000 |
58 __today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:00.000 |
59 __today__ 00:00:00.000 | 101 | 1011 | __tomorrow__ 00:00:02.000 |
60 __today__ 00:00:01.000 | 102 | 1012 | NULL |
61 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
62 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
63 taos> select b.c from a1 a full join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
64 c |
65 ======
66 a |
67 a |
68 a |
69 a |
70 NU. |
71 NU. |
72 NU. |
73 taos> select b.ts from a1 a full join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
74 ts |
75 ==========================
76 __today__ 00:00:00.000 |
77 __today__ 00:00:00.000 |
78 __today__ 00:00:00.000 |
79 __today__ 00:00:00.000 |
80 NULL |
81 NULL |
82 NULL |
83 taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
84 ts | f | g | ts1 | ts | f | g | 'a' |
85 ============================================================================================================================================
86 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
87 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
88 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
89 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
90 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
91 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
92 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
93 taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
94 ts | f | g |
95 ======================================================
96 __today__ 00:00:00.000 | 101 | 1011 |
97 __today__ 00:00:00.000 | 101 | 1011 |
98 __today__ 00:00:00.000 | 101 | 1011 |
99 __today__ 00:00:00.000 | 101 | 1011 |
100 __today__ 00:00:01.000 | 102 | 1012 |
101 __tomorrow__ 00:00:00.000 | 103 | 1013 |
102 __tomorrow__ 00:00:02.000 | 104 | 1014 |
103 taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
104 ts1 | ts | f | g | 'a' |
105 ======================================================================================
106 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
107 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
108 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
109 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
110 NULL | NULL | NULL | NULL | NU. |
111 NULL | NULL | NULL | NULL | NU. |
112 NULL | NULL | NULL | NULL | NU. |
113 taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
114 c |
115 ======
116 a |
117 a |
118 a |
119 a |
120 NU. |
121 NU. |
122 NU. |
123 taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
124 ts | f | g | ts1 | ts | f | g | c |
125 ============================================================================================================================================
126 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
127 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
128 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
129 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
130 taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
131 ts | f | g |
132 ======================================================
133 __today__ 00:00:00.000 | 101 | 1011 |
134 __today__ 00:00:01.000 | 102 | 1012 |
135 __tomorrow__ 00:00:00.000 | 103 | 1013 |
136 __tomorrow__ 00:00:02.000 | 104 | 1014 |
137 taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
138 ts1 | ts | f | g | c |
139 ======================================================================================
140 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
141 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
142 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
143 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
144 taos> select b.ts1,a.ts from a1 a full join (select today() as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
145 ts1 | ts |
146 ====================================================
147 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
148 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
149 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
150 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
151 NULL | __today__ 00:00:01.000 |
152 NULL | __tomorrow__ 00:00:00.000 |
153 NULL | __tomorrow__ 00:00:02.000 |
154 taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
155 ts | f | g | ts1 | ts | f | g | 'a' |
156 ============================================================================================================================================
157 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
158 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
159 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
160 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
161 taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
162 ts | f | g |
163 ======================================================
164 __today__ 00:00:00.000 | 101 | 1011 |
165 __today__ 00:00:01.000 | 102 | 1012 |
166 __tomorrow__ 00:00:00.000 | 103 | 1013 |
167 __tomorrow__ 00:00:02.000 | 104 | 1014 |
168 taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
169 ts1 | ts | f | g | 'a' |
170 ======================================================================================
171 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
172 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
173 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
174 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
175 taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
176 c |
177 ======
178 a |
179 a |
180 a |
181 a |
182 taos> select b.ts from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
183 ts |
184 ==========================
185 __today__ 00:00:00.000 |
186 __today__ 00:00:01.000 |
187 __tomorrow__ 00:00:00.000 |
188 __tomorrow__ 00:00:02.000 |
189 taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
190 ts | f | g | ts1 | ts | f | g | 'a' |
191 ============================================================================================================================================
192 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
193 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
194 NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
195 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
196 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
197 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
198 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
199 taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
200 ts | f | g |
201 ======================================================
202 __today__ 00:00:00.000 | 101 | 1011 |
203 __today__ 00:00:01.000 | 102 | 1012 |
204 NULL | NULL | NULL |
205 __tomorrow__ 00:00:00.000 | 103 | 1013 |
206 NULL | NULL | NULL |
207 __tomorrow__ 00:00:02.000 | 104 | 1014 |
208 NULL | NULL | NULL |
209 taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
210 ts1 | ts | f | g | 'a' |
211 ======================================================================================
212 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
213 NULL | NULL | NULL | NULL | NU. |
214 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
215 NULL | NULL | NULL | NULL | NU. |
216 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
217 NULL | NULL | NULL | NULL | NU. |
218 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
219 taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
220 c |
221 ======
222 a |
223 NU. |
224 a |
225 NU. |
226 a |
227 NU. |
228 a |
229 taos> select b.ts from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
230 ts |
231 ==========================
232 __today__ 00:00:00.000 |
233 NULL |
234 __today__ 00:00:01.000 |
235 NULL |
236 __tomorrow__ 00:00:00.000 |
237 NULL |
238 __tomorrow__ 00:00:02.000 |
239 taos> select * from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
240 ts | f | g | ts1 | ts | f | g | 'a' |
241 ============================================================================================================================================
242 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
243 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
244 NULL | NULL | NULL | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
245 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
246 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
247 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
248 NULL | NULL | NULL | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
249 taos> select a.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
250 ts | f | g |
251 ======================================================
252 __today__ 00:00:00.000 | 101 | 1011 |
253 __today__ 00:00:01.000 | 102 | 1012 |
254 NULL | NULL | NULL |
255 __tomorrow__ 00:00:00.000 | 103 | 1013 |
256 NULL | NULL | NULL |
257 __tomorrow__ 00:00:02.000 | 104 | 1014 |
258 NULL | NULL | NULL |
259 taos> select b.* from a1 a full join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
260 ts1 | ts | f | g | 'a' |
261 ======================================================================================
262 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
263 NULL | NULL | NULL | NULL | NU. |
264 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
265 NULL | NULL | NULL | NULL | NU. |
266 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
267 NULL | NULL | NULL | NULL | NU. |
268 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
269 taos> select b.c from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
270 c |
271 ======
272 a |
273 NU. |
274 a |
275 NU. |
276 a |
277 NU. |
278 a |
279 taos> select b.ts from a1 a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
280 ts |
281 ==========================
282 __today__ 00:00:00.000 |
283 NULL |
284 __today__ 00:00:01.000 |
285 NULL |
286 __tomorrow__ 00:00:00.000 |
287 NULL |
288 __tomorrow__ 00:00:02.000 |
289 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
290 ts |
291 ==========================
292 __today__ 00:00:00.000 |
293 NULL |
294 __today__ 00:00:01.000 |
295 NULL |
296 __tomorrow__ 00:00:00.000 |
297 NULL |
298 __tomorrow__ 00:00:02.000 |
299 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
300 ts |
301 ==========================
302 __today__ 00:00:00.000 |
303 __today__ 00:00:01.000 |
304 __tomorrow__ 00:00:00.000 |
305 __tomorrow__ 00:00:02.000 |
306 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
307 ts |
308 ==========================
309 __today__ 00:00:00.000 |
310 __tomorrow__ 00:00:02.000 |
311 __tomorrow__ 00:00:00.000 |
312 __today__ 00:00:01.000 |
313 NULL |
314 NULL |
315 NULL |
316 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
317 ts |
318 ==========================
319 __today__ 00:00:00.000 |
320 __today__ 00:00:01.000 |
321 __tomorrow__ 00:00:00.000 |
322 __tomorrow__ 00:00:02.000 |
323 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a full join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
324 ts |
325 ==========================
326 __today__ 00:00:00.000 |
327 __tomorrow__ 00:00:02.000 |
328 __tomorrow__ 00:00:00.000 |
329 __today__ 00:00:01.000 |
330 NULL |
331 NULL |
332 NULL |
333 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a full join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
334 ts |
335 ==========================
336 NULL |
337 __today__ 00:00:00.000 |
338 NULL |
339 __today__ 00:00:01.000 |
340 NULL |
341 __tomorrow__ 00:00:00.000 |
342 NULL |
343 __tomorrow__ 00:00:02.000 |
344 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta full join (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
345 ts | val | tg1 | ts | val | tg1 |
346 ============================================================================================================
347 NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 1 |
348 __tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
349 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
350 ts | val | tg2 | ts | val | tg2 |
351 ============================================================================================================
352 NULL | NULL | NULL | __today__ 00:00:00.000 | 304 | 1 |
353 NULL | NULL | NULL | __today__ 00:00:00.000 | 404 | 2 |
354 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
355 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
356 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
357 ts | val | tg2 | ts | val | tg2 |
358 ============================================================================================================
359 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
360 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
361 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
362 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
363 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
364 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
365 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
366 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
367 __today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
368 __today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
369 __tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
370 __tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
371 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
372 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
373 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
374 ts | val | tg2 | ts | val | tg2 |
375 ============================================================================================================
376 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
377 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 302 | 1 |
378 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
379 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 304 | 1 |
380 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
381 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 402 | 2 |
382 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 403 | 2 |
383 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 404 | 2 |
384 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta full join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
385 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta full join (select today() + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
386 ts | val | tg2 | ts | val | tg2 |
387 ============================================================================================================
388 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
389 __tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
390 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 304 | 1 |
391 taos> select * from (select today() as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
392 ts | f | g | 'a' | ts | f | g |
393 ==================================================================================================================
394 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
395 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
396 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
397 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
398 NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
399 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
400 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
401 taos> select * from (select today() as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
402 ts1 | f | g | 'a' | ts | f | g |
403 ==================================================================================================================
404 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
405 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
406 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
407 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
408 NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
409 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
410 NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
411 taos> select a.* from (select today() as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
412 ts | f | g |
413 ======================================================
414 __today__ 00:00:00.000 | 101 | 1011 |
415 __today__ 00:00:00.000 | 101 | 1011 |
416 __today__ 00:00:00.000 | 101 | 1011 |
417 __today__ 00:00:00.000 | 101 | 1011 |
418 __today__ 00:00:01.000 | 102 | 1012 |
419 __tomorrow__ 00:00:00.000 | 103 | 1013 |
420 __tomorrow__ 00:00:02.000 | 104 | 1014 |
421 taos> select b.* from (select today() as ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
422 ts | f | g | 'a' |
423 ============================================================
424 __today__ 00:00:00.000 | 301 | 3011 | a |
425 __today__ 00:00:00.000 | 302 | 3012 | a |
426 __today__ 00:00:00.000 | 303 | 3013 | a |
427 __today__ 00:00:00.000 | 304 | 3014 | a |
428 NULL | NULL | NULL | NU. |
429 NULL | NULL | NULL | NU. |
430 NULL | NULL | NULL | NU. |
431 taos> select b.* from (select today() as ts1, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts1;
432 ts1 | f | g | 'a' |
433 ============================================================
434 __today__ 00:00:00.000 | 301 | 3011 | a |
435 __today__ 00:00:00.000 | 302 | 3012 | a |
436 __today__ 00:00:00.000 | 303 | 3013 | a |
437 __today__ 00:00:00.000 | 304 | 3014 | a |
438 NULL | NULL | NULL | NU. |
439 NULL | NULL | NULL | NU. |
440 NULL | NULL | NULL | NU. |
441 taos> select b.c from (select today() as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
442 c |
443 ======
444 a |
445 a |
446 a |
447 a |
448 NU. |
449 NU. |
450 NU. |
451 taos> select b.ts from (select today() as ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
452 ts |
453 ==========================
454 __today__ 00:00:00.000 |
455 __today__ 00:00:00.000 |
456 __today__ 00:00:00.000 |
457 __today__ 00:00:00.000 |
458 NULL |
459 NULL |
460 NULL |
461 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
462 ts1 | ts | f | g | 'a' | ts | f | g |
463 ============================================================================================================================================
464 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
465 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
466 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
467 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
468 NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
469 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
470 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
471 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
472 ts | f | g |
473 ======================================================
474 __today__ 00:00:00.000 | 101 | 1011 |
475 __today__ 00:00:00.000 | 101 | 1011 |
476 __today__ 00:00:00.000 | 101 | 1011 |
477 __today__ 00:00:00.000 | 101 | 1011 |
478 __today__ 00:00:01.000 | 102 | 1012 |
479 __tomorrow__ 00:00:00.000 | 103 | 1013 |
480 __tomorrow__ 00:00:02.000 | 104 | 1014 |
481 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts;
482 ts1 | ts | f | g | 'a' |
483 ======================================================================================
484 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
485 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
486 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
487 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
488 NULL | NULL | NULL | NULL | NU. |
489 NULL | NULL | NULL | NULL | NU. |
490 NULL | NULL | NULL | NULL | NU. |
491 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
492 c |
493 ======
494 a |
495 a |
496 a |
497 a |
498 NU. |
499 NU. |
500 NU. |
501 taos> select b.ts1 from (select today() as ts1, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts;
502 ts1 |
503 ==========================
504 __today__ 00:00:00.000 |
505 __today__ 00:00:00.000 |
506 __today__ 00:00:00.000 |
507 __today__ 00:00:00.000 |
508 NULL |
509 NULL |
510 NULL |
511 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
512 ts1 | ts | f | g | 'a' | ts | f | g |
513 ============================================================================================================================================
514 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
515 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
516 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
517 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
518 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
519 ts | f | g |
520 ======================================================
521 __today__ 00:00:00.000 | 101 | 1011 |
522 __today__ 00:00:01.000 | 102 | 1012 |
523 __tomorrow__ 00:00:00.000 | 103 | 1013 |
524 __tomorrow__ 00:00:02.000 | 104 | 1014 |
525 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on a.ts = b.ts;
526 ts1 | ts | f | g | 'a' |
527 ======================================================================================
528 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
529 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
530 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
531 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
532 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
533 c |
534 ======
535 a |
536 a |
537 a |
538 a |
539 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on a.ts = b.ts;
540 ts |
541 ==========================
542 __today__ 00:00:00.000 |
543 __today__ 00:00:01.000 |
544 __tomorrow__ 00:00:00.000 |
545 __tomorrow__ 00:00:02.000 |
546 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
547 ts1 | ts | f | g | 'a' | ts | f | g |
548 ============================================================================================================================================
549 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
550 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
551 NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
552 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
553 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
554 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
555 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
556 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
557 ts | f | g |
558 ======================================================
559 __today__ 00:00:00.000 | 101 | 1011 |
560 NULL | NULL | NULL |
561 __today__ 00:00:01.000 | 102 | 1012 |
562 NULL | NULL | NULL |
563 __tomorrow__ 00:00:00.000 | 103 | 1013 |
564 NULL | NULL | NULL |
565 __tomorrow__ 00:00:02.000 | 104 | 1014 |
566 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
567 ts1 | ts | f | g | 'a' |
568 ======================================================================================
569 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
570 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
571 NULL | NULL | NULL | NULL | NU. |
572 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
573 NULL | NULL | NULL | NULL | NU. |
574 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
575 NULL | NULL | NULL | NULL | NU. |
576 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
577 c |
578 ======
579 a |
580 a |
581 NU. |
582 a |
583 NU. |
584 a |
585 NU. |
586 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts1 = a.ts and a.ts = b.ts;
587 ts |
588 ==========================
589 __today__ 00:00:00.000 |
590 __today__ 00:00:01.000 |
591 NULL |
592 __tomorrow__ 00:00:00.000 |
593 NULL |
594 __tomorrow__ 00:00:02.000 |
595 NULL |
596 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
597 ts1 | ts | f | g | 'a' | ts | f | g |
598 ============================================================================================================================================
599 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
600 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
601 NULL | NULL | NULL | NULL | NU. | __today__ 00:00:01.000 | 102 | 1012 |
602 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
603 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:00.000 | 103 | 1013 |
604 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
605 NULL | NULL | NULL | NULL | NU. | __tomorrow__ 00:00:02.000 | 104 | 1014 |
606 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
607 ts | f | g |
608 ======================================================
609 __today__ 00:00:00.000 | 101 | 1011 |
610 NULL | NULL | NULL |
611 __today__ 00:00:01.000 | 102 | 1012 |
612 NULL | NULL | NULL |
613 __tomorrow__ 00:00:00.000 | 103 | 1013 |
614 NULL | NULL | NULL |
615 __tomorrow__ 00:00:02.000 | 104 | 1014 |
616 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
617 ts1 | ts | f | g | 'a' |
618 ======================================================================================
619 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
620 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
621 NULL | NULL | NULL | NULL | NU. |
622 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
623 NULL | NULL | NULL | NULL | NU. |
624 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
625 NULL | NULL | NULL | NULL | NU. |
626 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
627 c |
628 ======
629 a |
630 a |
631 NU. |
632 a |
633 NU. |
634 a |
635 NU. |
636 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b full join a1 a on b.ts = a.ts and a.ts = b.ts1;
637 ts |
638 ==========================
639 __today__ 00:00:00.000 |
640 __today__ 00:00:01.000 |
641 NULL |
642 __tomorrow__ 00:00:00.000 |
643 NULL |
644 __tomorrow__ 00:00:02.000 |
645 NULL |
646 taos> select * from (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
647 ts | val | tg1 | ts | val | tg1 |
648 ============================================================================================================
649 __today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
650 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 1 |
651 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
652 ts | val | tg2 | ts | val | tg2 |
653 ============================================================================================================
654 __today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
655 __today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
656 NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
657 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
658 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.val, tb.val;
659 ts | val | tg2 | ts | val | tg2 |
660 ============================================================================================================
661 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
662 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
663 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
664 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
665 NULL | NULL | NULL | __today__ 00:00:01.000 | 102 | 1 |
666 NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 103 | 1 |
667 NULL | NULL | NULL | __tomorrow__ 00:00:02.000 | 104 | 1 |
668 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
669 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
670 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
671 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
672 NULL | NULL | NULL | __today__ 00:00:01.000 | 202 | 2 |
673 NULL | NULL | NULL | __tomorrow__ 00:00:00.000 | 203 | 2 |
674 NULL | NULL | NULL | __tomorrow__ 00:00:03.000 | 204 | 2 |
675 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
676 ts | val | tg2 | ts | val | tg2 |
677 ============================================================================================================
678 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
679 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
680 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
681 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
682 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
683 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
684 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
685 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
686 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb full join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();

View File

@ -0,0 +1,365 @@
taos> use test;
Database changed.
taos> select * from a1 a left anti join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts | f | g | 'a' |
==================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select * from a1 a left anti join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts1 | f | g | 'a' |
==================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.* from a1 a left anti join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select a.*, b.ts from a1 a left anti join (select today as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts |
================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
taos> select b.c from a1 a left anti join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
NU. |
NU. |
NU. |
taos> select b.ts from a1 a left anti join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
NULL |
NULL |
NULL |
taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
c |
======
NU. |
NU. |
NU. |
taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
taos> select b.ts1,a.ts from a1 a left anti join (select today as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
ts1 | ts |
====================================================
NULL | __today__ 00:00:01.000 |
NULL | __tomorrow__ 00:00:00.000 |
NULL | __tomorrow__ 00:00:02.000 |
taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
taos> select b.ts from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
c |
======
NU. |
NU. |
NU. |
taos> select b.ts from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
NULL |
NULL |
NULL |
taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
c |
======
NU. |
NU. |
NU. |
taos> select b.ts from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left anti join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left anti join (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
__tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
__today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
taos> select * from (select today as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select * from (select today as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
taos> select a.* from (select today as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.* from (select today as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.* from (select today as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
taos> select b.c from (select today as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.ts from (select today as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select b.ts1 from (select today as ts1, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
NULL | NULL | NULL |
NULL | NULL | NULL |
NULL | NULL | NULL |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
a |
a |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
NULL | NULL | NULL |
NULL | NULL | NULL |
NULL | NULL | NULL |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
a |
a |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
__today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
__today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
1 taos> use test;
2 Database changed.
3 taos> select * from a1 a left anti join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
4 ts | f | g | ts | f | g | 'a' |
5 ==================================================================================================================
6 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
7 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
8 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
9 taos> select * from a1 a left anti join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
10 ts | f | g | ts1 | f | g | 'a' |
11 ==================================================================================================================
12 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
13 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
14 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
15 taos> select a.* from a1 a left anti join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
16 ts | f | g |
17 ======================================================
18 __today__ 00:00:01.000 | 102 | 1012 |
19 __tomorrow__ 00:00:00.000 | 103 | 1013 |
20 __tomorrow__ 00:00:02.000 | 104 | 1014 |
21 taos> select b.* from a1 a left anti join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
22 ts | f | g | 'a' |
23 ============================================================
24 NULL | NULL | NULL | NU. |
25 NULL | NULL | NULL | NU. |
26 NULL | NULL | NULL | NU. |
27 taos> select b.* from a1 a left anti join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
28 ts1 | f | g | 'a' |
29 ============================================================
30 NULL | NULL | NULL | NU. |
31 NULL | NULL | NULL | NU. |
32 NULL | NULL | NULL | NU. |
33 taos> select a.*, b.ts from a1 a left anti join (select today as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
34 ts | f | g | ts |
35 ================================================================================
36 __today__ 00:00:01.000 | 102 | 1012 | NULL |
37 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
38 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
39 taos> select b.c from a1 a left anti join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
40 c |
41 ======
42 NU. |
43 NU. |
44 NU. |
45 taos> select b.ts from a1 a left anti join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
46 ts |
47 ==========================
48 NULL |
49 NULL |
50 NULL |
51 taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
52 ts | f | g | ts1 | ts | f | g | 'a' |
53 ============================================================================================================================================
54 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
55 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
56 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
57 taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
58 ts | f | g |
59 ======================================================
60 __today__ 00:00:01.000 | 102 | 1012 |
61 __tomorrow__ 00:00:00.000 | 103 | 1013 |
62 __tomorrow__ 00:00:02.000 | 104 | 1014 |
63 taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
64 ts1 | ts | f | g | 'a' |
65 ======================================================================================
66 NULL | NULL | NULL | NULL | NU. |
67 NULL | NULL | NULL | NULL | NU. |
68 NULL | NULL | NULL | NULL | NU. |
69 taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
70 c |
71 ======
72 NU. |
73 NU. |
74 NU. |
75 taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
76 taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
77 taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
78 taos> select b.ts1,a.ts from a1 a left anti join (select today as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
79 ts1 | ts |
80 ====================================================
81 NULL | __today__ 00:00:01.000 |
82 NULL | __tomorrow__ 00:00:00.000 |
83 NULL | __tomorrow__ 00:00:02.000 |
84 taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
85 taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
86 taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
87 taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
88 taos> select b.ts from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
89 taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
90 ts | f | g | ts1 | ts | f | g | 'a' |
91 ============================================================================================================================================
92 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
93 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
94 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
95 taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
96 ts | f | g |
97 ======================================================
98 __today__ 00:00:01.000 | 102 | 1012 |
99 __tomorrow__ 00:00:00.000 | 103 | 1013 |
100 __tomorrow__ 00:00:02.000 | 104 | 1014 |
101 taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
102 ts1 | ts | f | g | 'a' |
103 ======================================================================================
104 NULL | NULL | NULL | NULL | NU. |
105 NULL | NULL | NULL | NULL | NU. |
106 NULL | NULL | NULL | NULL | NU. |
107 taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
108 c |
109 ======
110 NU. |
111 NU. |
112 NU. |
113 taos> select b.ts from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
114 ts |
115 ==========================
116 NULL |
117 NULL |
118 NULL |
119 taos> select * from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
120 ts | f | g | ts1 | ts | f | g | 'a' |
121 ============================================================================================================================================
122 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
123 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
124 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
125 taos> select a.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
126 ts | f | g |
127 ======================================================
128 __today__ 00:00:01.000 | 102 | 1012 |
129 __tomorrow__ 00:00:00.000 | 103 | 1013 |
130 __tomorrow__ 00:00:02.000 | 104 | 1014 |
131 taos> select b.* from a1 a left anti join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
132 ts1 | ts | f | g | 'a' |
133 ======================================================================================
134 NULL | NULL | NULL | NULL | NU. |
135 NULL | NULL | NULL | NULL | NU. |
136 NULL | NULL | NULL | NULL | NU. |
137 taos> select b.c from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
138 c |
139 ======
140 NU. |
141 NU. |
142 NU. |
143 taos> select b.ts from a1 a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
144 ts |
145 ==========================
146 NULL |
147 NULL |
148 NULL |
149 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
150 ts |
151 ==========================
152 NULL |
153 NULL |
154 NULL |
155 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
156 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
157 ts |
158 ==========================
159 NULL |
160 NULL |
161 NULL |
162 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
163 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
164 ts |
165 ==========================
166 NULL |
167 NULL |
168 NULL |
169 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left anti join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
170 ts |
171 ==========================
172 NULL |
173 NULL |
174 NULL |
175 NULL |
176 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left anti join (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
177 ts | val | tg1 | ts | val | tg1 |
178 ============================================================================================================
179 __tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
180 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
181 ts | val | tg2 | ts | val | tg2 |
182 ============================================================================================================
183 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
184 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
185 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
186 ts | val | tg2 | ts | val | tg2 |
187 ============================================================================================================
188 __today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
189 __today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
190 __tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
191 __tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
192 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
193 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
194 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
195 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
196 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
197 ts | val | tg2 | ts | val | tg2 |
198 ============================================================================================================
199 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
200 taos> select * from (select today as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
201 taos> select * from (select today as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
202 taos> select a.* from (select today as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
203 taos> select b.* from (select today as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
204 taos> select b.* from (select today as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
205 taos> select b.c from (select today as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
206 taos> select b.ts from (select today as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
207 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
208 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
209 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
210 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
211 taos> select b.ts1 from (select today as ts1, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
212 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
213 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
214 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
215 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
216 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
217 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
218 ts1 | ts | f | g | 'a' | ts | f | g |
219 ============================================================================================================================================
220 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
221 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
222 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
223 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
224 ts | f | g |
225 ======================================================
226 NULL | NULL | NULL |
227 NULL | NULL | NULL |
228 NULL | NULL | NULL |
229 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
230 ts1 | ts | f | g | 'a' |
231 ======================================================================================
232 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
233 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
234 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
235 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
236 c |
237 ======
238 a |
239 a |
240 a |
241 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
242 ts |
243 ==========================
244 __today__ 00:00:01.000 |
245 __tomorrow__ 00:00:00.000 |
246 __tomorrow__ 00:00:02.000 |
247 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
248 ts1 | ts | f | g | 'a' | ts | f | g |
249 ============================================================================================================================================
250 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
251 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
252 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
253 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
254 ts | f | g |
255 ======================================================
256 NULL | NULL | NULL |
257 NULL | NULL | NULL |
258 NULL | NULL | NULL |
259 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
260 ts1 | ts | f | g | 'a' |
261 ======================================================================================
262 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
263 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
264 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
265 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
266 c |
267 ======
268 a |
269 a |
270 a |
271 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
272 ts |
273 ==========================
274 __today__ 00:00:01.000 |
275 __tomorrow__ 00:00:00.000 |
276 __tomorrow__ 00:00:02.000 |
277 taos> select * from (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
278 ts | val | tg1 | ts | val | tg1 |
279 ============================================================================================================
280 __today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
281 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
282 ts | val | tg2 | ts | val | tg2 |
283 ============================================================================================================
284 __today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
285 __today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
286 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
287 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
288 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;

View File

@ -0,0 +1,79 @@
use test;
select * from a1 a left anti join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select * from a1 a left anti join (select __today__ as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
select a.* from a1 a left anti join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a left anti join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a left anti join (select __today__ as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
select a.*, b.ts from a1 a left anti join (select __today__ as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
select b.c from a1 a left anti join (select __today__ as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select b.ts from a1 a left anti join (select __today__ as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select * from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select a.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select b.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select b.c from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
select * from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select a.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select b.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select b.ts1,a.ts from a1 a left anti join (select __today__ as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
select * from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select a.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.c from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select b.ts from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select * from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select a.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.c from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.ts from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select * from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select a.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.* from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.c from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from a1 a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a left anti join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left anti join (select __today__ ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=__today__ where tb.ts=__today__ order by tb.val;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>__today__ where tb.ts>__today__;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select __today__ + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select __today__ as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
select a.* from (select __today__ as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
select b.c from (select __today__ as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
select b.ts from (select __today__ as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
select b.ts1 from (select __today__ as ts1, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
select * from (select __today__ ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=__today__ where tb.ts=__today__ order by tb.val;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>__today__ where tb.ts>__today__;

View File

@ -0,0 +1,365 @@
taos> use test;
Database changed.
taos> select * from a1 a left anti join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts | f | g | 'a' |
==================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select * from a1 a left anti join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts1 | f | g | 'a' |
==================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select b.* from a1 a left anti join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NU. |
taos> select a.*, b.ts from a1 a left anti join (select today() as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts |
================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
taos> select b.c from a1 a left anti join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
NU. |
NU. |
NU. |
taos> select b.ts from a1 a left anti join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
NULL |
NULL |
NULL |
taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
c |
======
NU. |
NU. |
NU. |
taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
taos> select b.ts1,a.ts from a1 a left anti join (select today() as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
ts1 | ts |
====================================================
NULL | __today__ 00:00:01.000 |
NULL | __tomorrow__ 00:00:00.000 |
NULL | __tomorrow__ 00:00:02.000 |
taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
taos> select b.ts from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
c |
======
NU. |
NU. |
NU. |
taos> select b.ts from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
NULL |
NULL |
NULL |
taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
__tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
NULL | NULL | NULL | NULL | NU. |
taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
c |
======
NU. |
NU. |
NU. |
taos> select b.ts from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left anti join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
NULL |
NULL |
NULL |
NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left anti join (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
__tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
__today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
__tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today() + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
taos> select * from (select today() as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select * from (select today() as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
taos> select a.* from (select today() as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.* from (select today() as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.* from (select today() as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
taos> select b.c from (select today() as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.ts from (select today() as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select b.ts1 from (select today() as ts1, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
NULL | NULL | NULL |
NULL | NULL | NULL |
NULL | NULL | NULL |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
a |
a |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
NULL | NULL | NULL |
NULL | NULL | NULL |
NULL | NULL | NULL |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
a |
a |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
ts | val | tg1 | ts | val | tg1 |
============================================================================================================
__today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
__today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
1 taos> use test;
2 Database changed.
3 taos> select * from a1 a left anti join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
4 ts | f | g | ts | f | g | 'a' |
5 ==================================================================================================================
6 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
7 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
8 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
9 taos> select * from a1 a left anti join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
10 ts | f | g | ts1 | f | g | 'a' |
11 ==================================================================================================================
12 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NU. |
13 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NU. |
14 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NU. |
15 taos> select a.* from a1 a left anti join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
16 ts | f | g |
17 ======================================================
18 __today__ 00:00:01.000 | 102 | 1012 |
19 __tomorrow__ 00:00:00.000 | 103 | 1013 |
20 __tomorrow__ 00:00:02.000 | 104 | 1014 |
21 taos> select b.* from a1 a left anti join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
22 ts | f | g | 'a' |
23 ============================================================
24 NULL | NULL | NULL | NU. |
25 NULL | NULL | NULL | NU. |
26 NULL | NULL | NULL | NU. |
27 taos> select b.* from a1 a left anti join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
28 ts1 | f | g | 'a' |
29 ============================================================
30 NULL | NULL | NULL | NU. |
31 NULL | NULL | NULL | NU. |
32 NULL | NULL | NULL | NU. |
33 taos> select a.*, b.ts from a1 a left anti join (select today() as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
34 ts | f | g | ts |
35 ================================================================================
36 __today__ 00:00:01.000 | 102 | 1012 | NULL |
37 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL |
38 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL |
39 taos> select b.c from a1 a left anti join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
40 c |
41 ======
42 NU. |
43 NU. |
44 NU. |
45 taos> select b.ts from a1 a left anti join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
46 ts |
47 ==========================
48 NULL |
49 NULL |
50 NULL |
51 taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
52 ts | f | g | ts1 | ts | f | g | 'a' |
53 ============================================================================================================================================
54 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
55 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
56 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
57 taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
58 ts | f | g |
59 ======================================================
60 __today__ 00:00:01.000 | 102 | 1012 |
61 __tomorrow__ 00:00:00.000 | 103 | 1013 |
62 __tomorrow__ 00:00:02.000 | 104 | 1014 |
63 taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
64 ts1 | ts | f | g | 'a' |
65 ======================================================================================
66 NULL | NULL | NULL | NULL | NU. |
67 NULL | NULL | NULL | NULL | NU. |
68 NULL | NULL | NULL | NULL | NU. |
69 taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
70 c |
71 ======
72 NU. |
73 NU. |
74 NU. |
75 taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
76 taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
77 taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
78 taos> select b.ts1,a.ts from a1 a left anti join (select today() as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
79 ts1 | ts |
80 ====================================================
81 NULL | __today__ 00:00:01.000 |
82 NULL | __tomorrow__ 00:00:00.000 |
83 NULL | __tomorrow__ 00:00:02.000 |
84 taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
85 taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
86 taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
87 taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
88 taos> select b.ts from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
89 taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
90 ts | f | g | ts1 | ts | f | g | 'a' |
91 ============================================================================================================================================
92 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
93 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
94 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
95 taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
96 ts | f | g |
97 ======================================================
98 __today__ 00:00:01.000 | 102 | 1012 |
99 __tomorrow__ 00:00:00.000 | 103 | 1013 |
100 __tomorrow__ 00:00:02.000 | 104 | 1014 |
101 taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
102 ts1 | ts | f | g | 'a' |
103 ======================================================================================
104 NULL | NULL | NULL | NULL | NU. |
105 NULL | NULL | NULL | NULL | NU. |
106 NULL | NULL | NULL | NULL | NU. |
107 taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
108 c |
109 ======
110 NU. |
111 NU. |
112 NU. |
113 taos> select b.ts from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
114 ts |
115 ==========================
116 NULL |
117 NULL |
118 NULL |
119 taos> select * from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
120 ts | f | g | ts1 | ts | f | g | 'a' |
121 ============================================================================================================================================
122 __today__ 00:00:01.000 | 102 | 1012 | NULL | NULL | NULL | NULL | NU. |
123 __tomorrow__ 00:00:00.000 | 103 | 1013 | NULL | NULL | NULL | NULL | NU. |
124 __tomorrow__ 00:00:02.000 | 104 | 1014 | NULL | NULL | NULL | NULL | NU. |
125 taos> select a.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
126 ts | f | g |
127 ======================================================
128 __today__ 00:00:01.000 | 102 | 1012 |
129 __tomorrow__ 00:00:00.000 | 103 | 1013 |
130 __tomorrow__ 00:00:02.000 | 104 | 1014 |
131 taos> select b.* from a1 a left anti join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
132 ts1 | ts | f | g | 'a' |
133 ======================================================================================
134 NULL | NULL | NULL | NULL | NU. |
135 NULL | NULL | NULL | NULL | NU. |
136 NULL | NULL | NULL | NULL | NU. |
137 taos> select b.c from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
138 c |
139 ======
140 NU. |
141 NU. |
142 NU. |
143 taos> select b.ts from a1 a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
144 ts |
145 ==========================
146 NULL |
147 NULL |
148 NULL |
149 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
150 ts |
151 ==========================
152 NULL |
153 NULL |
154 NULL |
155 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
156 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
157 ts |
158 ==========================
159 NULL |
160 NULL |
161 NULL |
162 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
163 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left anti join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
164 ts |
165 ==========================
166 NULL |
167 NULL |
168 NULL |
169 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left anti join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
170 ts |
171 ==========================
172 NULL |
173 NULL |
174 NULL |
175 NULL |
176 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left anti join (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
177 ts | val | tg1 | ts | val | tg1 |
178 ============================================================================================================
179 __tomorrow__ 00:00:03.000 | 204 | 1 | NULL | NULL | NULL |
180 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
181 ts | val | tg2 | ts | val | tg2 |
182 ============================================================================================================
183 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
184 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
185 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
186 ts | val | tg2 | ts | val | tg2 |
187 ============================================================================================================
188 __today__ 00:00:01.000 | 102 | 1 | NULL | NULL | NULL |
189 __today__ 00:00:01.000 | 202 | 2 | NULL | NULL | NULL |
190 __tomorrow__ 00:00:00.000 | 103 | 1 | NULL | NULL | NULL |
191 __tomorrow__ 00:00:00.000 | 203 | 2 | NULL | NULL | NULL |
192 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
193 __tomorrow__ 00:00:03.000 | 204 | 2 | NULL | NULL | NULL |
194 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
195 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left anti join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
196 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left anti join (select today() + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
197 ts | val | tg2 | ts | val | tg2 |
198 ============================================================================================================
199 __tomorrow__ 00:00:02.000 | 104 | 1 | NULL | NULL | NULL |
200 taos> select * from (select today() as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
201 taos> select * from (select today() as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
202 taos> select a.* from (select today() as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
203 taos> select b.* from (select today() as ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
204 taos> select b.* from (select today() as ts1, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts1;
205 taos> select b.c from (select today() as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
206 taos> select b.ts from (select today() as ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
207 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
208 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
209 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts;
210 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
211 taos> select b.ts1 from (select today() as ts1, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts;
212 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
213 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
214 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on a.ts = b.ts;
215 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
216 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on a.ts = b.ts;
217 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
218 ts1 | ts | f | g | 'a' | ts | f | g |
219 ============================================================================================================================================
220 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
221 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
222 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
223 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
224 ts | f | g |
225 ======================================================
226 NULL | NULL | NULL |
227 NULL | NULL | NULL |
228 NULL | NULL | NULL |
229 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
230 ts1 | ts | f | g | 'a' |
231 ======================================================================================
232 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
233 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
234 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
235 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
236 c |
237 ======
238 a |
239 a |
240 a |
241 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts1 = a.ts and a.ts = b.ts;
242 ts |
243 ==========================
244 __today__ 00:00:01.000 |
245 __tomorrow__ 00:00:00.000 |
246 __tomorrow__ 00:00:02.000 |
247 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
248 ts1 | ts | f | g | 'a' | ts | f | g |
249 ============================================================================================================================================
250 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | NULL | NULL | NULL |
251 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | NULL | NULL | NULL |
252 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | NULL | NULL | NULL |
253 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
254 ts | f | g |
255 ======================================================
256 NULL | NULL | NULL |
257 NULL | NULL | NULL |
258 NULL | NULL | NULL |
259 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
260 ts1 | ts | f | g | 'a' |
261 ======================================================================================
262 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
263 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
264 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
265 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
266 c |
267 ======
268 a |
269 a |
270 a |
271 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left anti join a1 a on b.ts = a.ts and a.ts = b.ts1;
272 ts |
273 ==========================
274 __today__ 00:00:01.000 |
275 __tomorrow__ 00:00:00.000 |
276 __tomorrow__ 00:00:02.000 |
277 taos> select * from (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
278 ts | val | tg1 | ts | val | tg1 |
279 ============================================================================================================
280 __today__ 00:00:00.000 | 404 | 1 | NULL | NULL | NULL |
281 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
282 ts | val | tg2 | ts | val | tg2 |
283 ============================================================================================================
284 __today__ 00:00:00.000 | 304 | 1 | NULL | NULL | NULL |
285 __today__ 00:00:00.000 | 404 | 2 | NULL | NULL | NULL |
286 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
287 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
288 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left anti join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();

View File

@ -0,0 +1,455 @@
taos> use test;
Database changed.
taos> select * from a1 a left semi join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select * from a1 a left semi join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts1 | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.* from a1 a left semi join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.*, b.ts from a1 a left semi join (select today as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts |
================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
taos> select b.c from a1 a left semi join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
taos> select b.ts from a1 a left semi join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
c |
======
a |
taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g | ts1 | ts | f | g | c |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts1 | ts | f | g | c |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.ts1,a.ts from a1 a left semi join (select today as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
ts1 | ts |
====================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
taos> select b.ts from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
taos> select b.ts from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left semi join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left semi join (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
taos> select * from (select today as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select * from (select today as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
taos> select b.* from (select today as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
taos> select b.c from (select today as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from (select today as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts1 from (select today as ts1, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
ts1 |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
1 taos> use test;
2 Database changed.
3 taos> select * from a1 a left semi join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
4 ts | f | g | ts | f | g | 'a' |
5 ==================================================================================================================
6 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
7 taos> select * from a1 a left semi join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
8 ts | f | g | ts1 | f | g | 'a' |
9 ==================================================================================================================
10 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
11 taos> select a.* from a1 a left semi join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
12 ts | f | g |
13 ======================================================
14 __today__ 00:00:00.000 | 101 | 1011 |
15 taos> select b.* from a1 a left semi join (select today as ts, f, g, 'a' from b1) b on a.ts = b.ts;
16 ts | f | g | 'a' |
17 ============================================================
18 __today__ 00:00:00.000 | 301 | 3011 | a |
19 taos> select b.* from a1 a left semi join (select today as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
20 ts1 | f | g | 'a' |
21 ============================================================
22 __today__ 00:00:00.000 | 301 | 3011 | a |
23 taos> select a.*, b.ts from a1 a left semi join (select today as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
24 ts | f | g | ts |
25 ================================================================================
26 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
27 taos> select b.c from a1 a left semi join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
28 c |
29 ======
30 a |
31 taos> select b.ts from a1 a left semi join (select today as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
32 ts |
33 ==========================
34 __today__ 00:00:00.000 |
35 taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
36 ts | f | g | ts1 | ts | f | g | 'a' |
37 ============================================================================================================================================
38 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
39 taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
40 ts | f | g |
41 ======================================================
42 __today__ 00:00:00.000 | 101 | 1011 |
43 taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
44 ts1 | ts | f | g | 'a' |
45 ======================================================================================
46 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
47 taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
48 c |
49 ======
50 a |
51 taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
52 ts | f | g | ts1 | ts | f | g | c |
53 ============================================================================================================================================
54 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
55 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
56 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
57 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
58 taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
59 ts | f | g |
60 ======================================================
61 __today__ 00:00:00.000 | 101 | 1011 |
62 __today__ 00:00:01.000 | 102 | 1012 |
63 __tomorrow__ 00:00:00.000 | 103 | 1013 |
64 __tomorrow__ 00:00:02.000 | 104 | 1014 |
65 taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
66 ts1 | ts | f | g | c |
67 ======================================================================================
68 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
69 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
70 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
71 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
72 taos> select b.ts1,a.ts from a1 a left semi join (select today as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
73 ts1 | ts |
74 ====================================================
75 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
76 taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
77 ts | f | g | ts1 | ts | f | g | 'a' |
78 ============================================================================================================================================
79 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
80 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
81 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
82 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
83 taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
84 ts | f | g |
85 ======================================================
86 __today__ 00:00:00.000 | 101 | 1011 |
87 __today__ 00:00:01.000 | 102 | 1012 |
88 __tomorrow__ 00:00:00.000 | 103 | 1013 |
89 __tomorrow__ 00:00:02.000 | 104 | 1014 |
90 taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
91 ts1 | ts | f | g | 'a' |
92 ======================================================================================
93 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
94 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
95 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
96 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
97 taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
98 c |
99 ======
100 a |
101 a |
102 a |
103 a |
104 taos> select b.ts from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
105 ts |
106 ==========================
107 __today__ 00:00:00.000 |
108 __today__ 00:00:01.000 |
109 __tomorrow__ 00:00:00.000 |
110 __tomorrow__ 00:00:02.000 |
111 taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
112 ts | f | g | ts1 | ts | f | g | 'a' |
113 ============================================================================================================================================
114 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
115 taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
116 ts | f | g |
117 ======================================================
118 __today__ 00:00:00.000 | 101 | 1011 |
119 taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
120 ts1 | ts | f | g | 'a' |
121 ======================================================================================
122 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
123 taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
124 c |
125 ======
126 a |
127 taos> select b.ts from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
128 ts |
129 ==========================
130 __today__ 00:00:00.000 |
131 taos> select * from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
132 ts | f | g | ts1 | ts | f | g | 'a' |
133 ============================================================================================================================================
134 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
135 taos> select a.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
136 ts | f | g |
137 ======================================================
138 __today__ 00:00:00.000 | 101 | 1011 |
139 taos> select b.* from a1 a left semi join (select today as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
140 ts1 | ts | f | g | 'a' |
141 ======================================================================================
142 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
143 taos> select b.c from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
144 c |
145 ======
146 a |
147 taos> select b.ts from a1 a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
148 ts |
149 ==========================
150 __today__ 00:00:00.000 |
151 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
152 ts |
153 ==========================
154 __today__ 00:00:00.000 |
155 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
156 ts |
157 ==========================
158 __today__ 00:00:00.000 |
159 __today__ 00:00:01.000 |
160 __tomorrow__ 00:00:00.000 |
161 __tomorrow__ 00:00:02.000 |
162 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
163 ts |
164 ==========================
165 __today__ 00:00:00.000 |
166 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
167 ts |
168 ==========================
169 __today__ 00:00:00.000 |
170 __today__ 00:00:01.000 |
171 __tomorrow__ 00:00:00.000 |
172 __tomorrow__ 00:00:02.000 |
173 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
174 ts |
175 ==========================
176 __today__ 00:00:00.000 |
177 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from a1) a left semi join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
178 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left semi join (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
179 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
180 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
181 ts | val | tg2 | ts | val | tg2 |
182 ============================================================================================================
183 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
184 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
185 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
186 ts | val | tg2 | ts | val | tg2 |
187 ============================================================================================================
188 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
189 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
190 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;
191 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
192 ts | val | tg2 | ts | val | tg2 |
193 ============================================================================================================
194 __tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
195 taos> select * from (select today as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
196 ts | f | g | 'a' | ts | f | g |
197 ==================================================================================================================
198 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
199 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
200 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
201 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
202 taos> select * from (select today as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
203 ts1 | f | g | 'a' | ts | f | g |
204 ==================================================================================================================
205 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
206 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
207 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
208 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
209 taos> select a.* from (select today as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
210 ts | f | g |
211 ======================================================
212 __today__ 00:00:00.000 | 101 | 1011 |
213 __today__ 00:00:00.000 | 101 | 1011 |
214 __today__ 00:00:00.000 | 101 | 1011 |
215 __today__ 00:00:00.000 | 101 | 1011 |
216 taos> select b.* from (select today as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
217 ts | f | g | 'a' |
218 ============================================================
219 __today__ 00:00:00.000 | 301 | 3011 | a |
220 __today__ 00:00:00.000 | 302 | 3012 | a |
221 __today__ 00:00:00.000 | 303 | 3013 | a |
222 __today__ 00:00:00.000 | 304 | 3014 | a |
223 taos> select b.* from (select today as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
224 ts1 | f | g | 'a' |
225 ============================================================
226 __today__ 00:00:00.000 | 301 | 3011 | a |
227 __today__ 00:00:00.000 | 302 | 3012 | a |
228 __today__ 00:00:00.000 | 303 | 3013 | a |
229 __today__ 00:00:00.000 | 304 | 3014 | a |
230 taos> select b.c from (select today as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
231 c |
232 ======
233 a |
234 a |
235 a |
236 a |
237 taos> select b.ts from (select today as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
238 ts |
239 ==========================
240 __today__ 00:00:00.000 |
241 __today__ 00:00:00.000 |
242 __today__ 00:00:00.000 |
243 __today__ 00:00:00.000 |
244 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
245 ts1 | ts | f | g | 'a' | ts | f | g |
246 ============================================================================================================================================
247 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
248 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
249 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
250 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
251 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
252 ts | f | g |
253 ======================================================
254 __today__ 00:00:00.000 | 101 | 1011 |
255 __today__ 00:00:00.000 | 101 | 1011 |
256 __today__ 00:00:00.000 | 101 | 1011 |
257 __today__ 00:00:00.000 | 101 | 1011 |
258 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
259 ts1 | ts | f | g | 'a' |
260 ======================================================================================
261 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
262 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
263 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
264 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
265 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
266 c |
267 ======
268 a |
269 a |
270 a |
271 a |
272 taos> select b.ts1 from (select today as ts1, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
273 ts1 |
274 ==========================
275 __today__ 00:00:00.000 |
276 __today__ 00:00:00.000 |
277 __today__ 00:00:00.000 |
278 __today__ 00:00:00.000 |
279 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
280 ts1 | ts | f | g | 'a' | ts | f | g |
281 ============================================================================================================================================
282 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
283 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
284 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
285 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
286 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
287 ts | f | g |
288 ======================================================
289 __today__ 00:00:00.000 | 101 | 1011 |
290 __today__ 00:00:01.000 | 102 | 1012 |
291 __tomorrow__ 00:00:00.000 | 103 | 1013 |
292 __tomorrow__ 00:00:02.000 | 104 | 1014 |
293 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
294 ts1 | ts | f | g | 'a' |
295 ======================================================================================
296 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
297 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
298 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
299 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
300 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
301 c |
302 ======
303 a |
304 a |
305 a |
306 a |
307 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
308 ts |
309 ==========================
310 __today__ 00:00:00.000 |
311 __today__ 00:00:01.000 |
312 __tomorrow__ 00:00:00.000 |
313 __tomorrow__ 00:00:02.000 |
314 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
315 ts1 | ts | f | g | 'a' | ts | f | g |
316 ============================================================================================================================================
317 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
318 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
319 ts | f | g |
320 ======================================================
321 __today__ 00:00:00.000 | 101 | 1011 |
322 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
323 ts1 | ts | f | g | 'a' |
324 ======================================================================================
325 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
326 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
327 c |
328 ======
329 a |
330 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
331 ts |
332 ==========================
333 __today__ 00:00:00.000 |
334 taos> select * from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
335 ts1 | ts | f | g | 'a' | ts | f | g |
336 ============================================================================================================================================
337 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
338 taos> select a.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
339 ts | f | g |
340 ======================================================
341 __today__ 00:00:00.000 | 101 | 1011 |
342 taos> select b.* from (select today as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
343 ts1 | ts | f | g | 'a' |
344 ======================================================================================
345 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
346 taos> select b.c from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
347 c |
348 ======
349 a |
350 taos> select b.ts from (select today as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
351 ts |
352 ==========================
353 __today__ 00:00:00.000 |
354 taos> select * from (select today ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
355 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
356 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
357 ts | val | tg2 | ts | val | tg2 |
358 ============================================================================================================
359 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
360 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
361 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
362 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
363 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
364 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
365 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
366 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
367 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today where tb.ts=today order by tb.val;
368 ts | val | tg2 | ts | val | tg2 |
369 ============================================================================================================
370 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
371 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
372 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
373 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
374 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
375 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
376 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
377 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
378 taos> select * from (select today ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today where tb.ts>today;

View File

@ -0,0 +1,79 @@
use test;
select * from a1 a left semi join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select * from a1 a left semi join (select __today__ as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
select a.* from a1 a left semi join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a left semi join (select __today__ as ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a left semi join (select __today__ as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
select a.*, b.ts from a1 a left semi join (select __today__ as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
select b.c from a1 a left semi join (select __today__ as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select b.ts from a1 a left semi join (select __today__ as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select * from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select a.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select b.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
select b.c from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
select * from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select a.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select b.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
select b.ts1,a.ts from a1 a left semi join (select __today__ as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
select * from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select a.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
select b.c from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select b.ts from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
select * from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select a.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.c from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select b.ts from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
select * from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select a.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.* from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.c from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from a1 a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select __today__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from a1) a left semi join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left semi join (select __today__ ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=__today__ where tb.ts=__today__ order by tb.val;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>__today__ where tb.ts>__today__;
select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select __today__ + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select __today__ as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
select a.* from (select __today__ as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
select b.c from (select __today__ as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
select b.ts from (select __today__ as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
select b.ts1 from (select __today__ as ts1, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
select * from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
select a.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.* from (select __today__ as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.c from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
select b.ts from (select __today__ as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
select * from (select __today__ ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=__today__ where tb.ts=__today__ order by tb.val;
select * from (select __today__ ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>__today__ where tb.ts>__today__;

View File

@ -0,0 +1,455 @@
taos> use test;
Database changed.
taos> select * from a1 a left semi join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select * from a1 a left semi join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts1 | f | g | 'a' |
==================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.* from a1 a left semi join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.*, b.ts from a1 a left semi join (select today() as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
ts | f | g | ts |
================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
taos> select b.c from a1 a left semi join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
taos> select b.ts from a1 a left semi join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
c |
======
a |
taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g | ts1 | ts | f | g | c |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
ts1 | ts | f | g | c |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.ts1,a.ts from a1 a left semi join (select today() as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
ts1 | ts |
====================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 |
taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
taos> select b.ts from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g | ts1 | ts | f | g | 'a' |
============================================================================================================================================
__today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
taos> select b.ts from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left semi join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left semi join (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
__today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today() + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
taos> select * from (select today() as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select * from (select today() as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' | ts | f | g |
==================================================================================================================
__today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today() as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today() as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
taos> select b.* from (select today() as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
ts1 | f | g | 'a' |
============================================================
__today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | 304 | 3014 | a |
taos> select b.c from (select today() as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from (select today() as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts1 from (select today() as ts1, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
ts1 |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
__today__ 00:00:00.000 |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
__today__ 00:00:01.000 | 102 | 1012 |
__tomorrow__ 00:00:00.000 | 103 | 1013 |
__tomorrow__ 00:00:02.000 | 104 | 1014 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
__today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
__today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
c |
======
a |
a |
a |
a |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
__today__ 00:00:01.000 |
__tomorrow__ 00:00:00.000 |
__tomorrow__ 00:00:02.000 |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
c |
======
a |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' | ts | f | g |
============================================================================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts | f | g |
======================================================
__today__ 00:00:00.000 | 101 | 1011 |
taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts1 | ts | f | g | 'a' |
======================================================================================
__today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
c |
======
a |
taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
ts |
==========================
__today__ 00:00:00.000 |
taos> select * from (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
ts | val | tg2 | ts | val | tg2 |
============================================================================================================
__today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
__today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
__today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
1 taos> use test;
2 Database changed.
3 taos> select * from a1 a left semi join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
4 ts | f | g | ts | f | g | 'a' |
5 ==================================================================================================================
6 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
7 taos> select * from a1 a left semi join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
8 ts | f | g | ts1 | f | g | 'a' |
9 ==================================================================================================================
10 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | 301 | 3011 | a |
11 taos> select a.* from a1 a left semi join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
12 ts | f | g |
13 ======================================================
14 __today__ 00:00:00.000 | 101 | 1011 |
15 taos> select b.* from a1 a left semi join (select today() as ts, f, g, 'a' from b1) b on a.ts = b.ts;
16 ts | f | g | 'a' |
17 ============================================================
18 __today__ 00:00:00.000 | 301 | 3011 | a |
19 taos> select b.* from a1 a left semi join (select today() as ts1, f, g, 'a' from b1) b on a.ts = b.ts1;
20 ts1 | f | g | 'a' |
21 ============================================================
22 __today__ 00:00:00.000 | 301 | 3011 | a |
23 taos> select a.*, b.ts from a1 a left semi join (select today() as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1;
24 ts | f | g | ts |
25 ================================================================================
26 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 |
27 taos> select b.c from a1 a left semi join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
28 c |
29 ======
30 a |
31 taos> select b.ts from a1 a left semi join (select today() as ts, f, g, 'a' c from b1) b on a.ts = b.ts;
32 ts |
33 ==========================
34 __today__ 00:00:00.000 |
35 taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
36 ts | f | g | ts1 | ts | f | g | 'a' |
37 ============================================================================================================================================
38 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
39 taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
40 ts | f | g |
41 ======================================================
42 __today__ 00:00:00.000 | 101 | 1011 |
43 taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts;
44 ts1 | ts | f | g | 'a' |
45 ======================================================================================
46 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
47 taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts;
48 c |
49 ======
50 a |
51 taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
52 ts | f | g | ts1 | ts | f | g | c |
53 ============================================================================================================================================
54 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
55 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
56 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
57 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
58 taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
59 ts | f | g |
60 ======================================================
61 __today__ 00:00:00.000 | 101 | 1011 |
62 __today__ 00:00:01.000 | 102 | 1012 |
63 __tomorrow__ 00:00:00.000 | 103 | 1013 |
64 __tomorrow__ 00:00:02.000 | 104 | 1014 |
65 taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
66 ts1 | ts | f | g | c |
67 ======================================================================================
68 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
69 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
70 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
71 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
72 taos> select b.ts1,a.ts from a1 a left semi join (select today() as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts;
73 ts1 | ts |
74 ====================================================
75 __today__ 00:00:00.000 | __today__ 00:00:00.000 |
76 taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
77 ts | f | g | ts1 | ts | f | g | 'a' |
78 ============================================================================================================================================
79 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
80 __today__ 00:00:01.000 | 102 | 1012 | __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
81 __tomorrow__ 00:00:00.000 | 103 | 1013 | __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
82 __tomorrow__ 00:00:02.000 | 104 | 1014 | __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
83 taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
84 ts | f | g |
85 ======================================================
86 __today__ 00:00:00.000 | 101 | 1011 |
87 __today__ 00:00:01.000 | 102 | 1012 |
88 __tomorrow__ 00:00:00.000 | 103 | 1013 |
89 __tomorrow__ 00:00:02.000 | 104 | 1014 |
90 taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
91 ts1 | ts | f | g | 'a' |
92 ======================================================================================
93 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
94 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
95 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
96 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
97 taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
98 c |
99 ======
100 a |
101 a |
102 a |
103 a |
104 taos> select b.ts from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts;
105 ts |
106 ==========================
107 __today__ 00:00:00.000 |
108 __today__ 00:00:01.000 |
109 __tomorrow__ 00:00:00.000 |
110 __tomorrow__ 00:00:02.000 |
111 taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
112 ts | f | g | ts1 | ts | f | g | 'a' |
113 ============================================================================================================================================
114 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
115 taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
116 ts | f | g |
117 ======================================================
118 __today__ 00:00:00.000 | 101 | 1011 |
119 taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts;
120 ts1 | ts | f | g | 'a' |
121 ======================================================================================
122 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
123 taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
124 c |
125 ======
126 a |
127 taos> select b.ts from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts;
128 ts |
129 ==========================
130 __today__ 00:00:00.000 |
131 taos> select * from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
132 ts | f | g | ts1 | ts | f | g | 'a' |
133 ============================================================================================================================================
134 __today__ 00:00:00.000 | 101 | 1011 | __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
135 taos> select a.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
136 ts | f | g |
137 ======================================================
138 __today__ 00:00:00.000 | 101 | 1011 |
139 taos> select b.* from a1 a left semi join (select today() as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1;
140 ts1 | ts | f | g | 'a' |
141 ======================================================================================
142 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
143 taos> select b.c from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
144 c |
145 ======
146 a |
147 taos> select b.ts from a1 a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
148 ts |
149 ==========================
150 __today__ 00:00:00.000 |
151 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
152 ts |
153 ==========================
154 __today__ 00:00:00.000 |
155 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
156 ts |
157 ==========================
158 __today__ 00:00:00.000 |
159 __today__ 00:00:01.000 |
160 __tomorrow__ 00:00:00.000 |
161 __tomorrow__ 00:00:02.000 |
162 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
163 ts |
164 ==========================
165 __today__ 00:00:00.000 |
166 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts1 and a.ts = b.ts;
167 ts |
168 ==========================
169 __today__ 00:00:00.000 |
170 __today__ 00:00:01.000 |
171 __tomorrow__ 00:00:00.000 |
172 __tomorrow__ 00:00:02.000 |
173 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1 order by f) a left semi join (select today() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
174 ts |
175 ==========================
176 __today__ 00:00:00.000 |
177 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from a1) a left semi join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1;
178 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta left semi join (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb on ta.ts=tb.ts and ta.tg1=tb.tg1;
179 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
180 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 order by ta.ts, ta.val, tb.val;
181 ts | val | tg2 | ts | val | tg2 |
182 ============================================================================================================
183 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 303 | 1 |
184 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
185 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
186 ts | val | tg2 | ts | val | tg2 |
187 ============================================================================================================
188 __today__ 00:00:00.000 | 101 | 1 | __today__ 00:00:00.000 | 301 | 1 |
189 __today__ 00:00:00.000 | 201 | 2 | __today__ 00:00:00.000 | 401 | 2 |
190 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta left semi join (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();
191 taos> select * from (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta left semi join (select today() + 1d +3s ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb on ta.ts=tb.ts and ta.tg2=tb.tg2;
192 ts | val | tg2 | ts | val | tg2 |
193 ============================================================================================================
194 __tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 |
195 taos> select * from (select today() as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
196 ts | f | g | 'a' | ts | f | g |
197 ==================================================================================================================
198 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
199 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
200 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
201 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
202 taos> select * from (select today() as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
203 ts1 | f | g | 'a' | ts | f | g |
204 ==================================================================================================================
205 __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
206 __today__ 00:00:00.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
207 __today__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
208 __today__ 00:00:00.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
209 taos> select a.* from (select today() as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
210 ts | f | g |
211 ======================================================
212 __today__ 00:00:00.000 | 101 | 1011 |
213 __today__ 00:00:00.000 | 101 | 1011 |
214 __today__ 00:00:00.000 | 101 | 1011 |
215 __today__ 00:00:00.000 | 101 | 1011 |
216 taos> select b.* from (select today() as ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
217 ts | f | g | 'a' |
218 ============================================================
219 __today__ 00:00:00.000 | 301 | 3011 | a |
220 __today__ 00:00:00.000 | 302 | 3012 | a |
221 __today__ 00:00:00.000 | 303 | 3013 | a |
222 __today__ 00:00:00.000 | 304 | 3014 | a |
223 taos> select b.* from (select today() as ts1, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts1;
224 ts1 | f | g | 'a' |
225 ============================================================
226 __today__ 00:00:00.000 | 301 | 3011 | a |
227 __today__ 00:00:00.000 | 302 | 3012 | a |
228 __today__ 00:00:00.000 | 303 | 3013 | a |
229 __today__ 00:00:00.000 | 304 | 3014 | a |
230 taos> select b.c from (select today() as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
231 c |
232 ======
233 a |
234 a |
235 a |
236 a |
237 taos> select b.ts from (select today() as ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
238 ts |
239 ==========================
240 __today__ 00:00:00.000 |
241 __today__ 00:00:00.000 |
242 __today__ 00:00:00.000 |
243 __today__ 00:00:00.000 |
244 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
245 ts1 | ts | f | g | 'a' | ts | f | g |
246 ============================================================================================================================================
247 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
248 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:00.000 | 101 | 1011 |
249 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __today__ 00:00:00.000 | 101 | 1011 |
250 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __today__ 00:00:00.000 | 101 | 1011 |
251 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
252 ts | f | g |
253 ======================================================
254 __today__ 00:00:00.000 | 101 | 1011 |
255 __today__ 00:00:00.000 | 101 | 1011 |
256 __today__ 00:00:00.000 | 101 | 1011 |
257 __today__ 00:00:00.000 | 101 | 1011 |
258 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts;
259 ts1 | ts | f | g | 'a' |
260 ======================================================================================
261 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
262 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
263 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
264 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
265 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
266 c |
267 ======
268 a |
269 a |
270 a |
271 a |
272 taos> select b.ts1 from (select today() as ts1, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts;
273 ts1 |
274 ==========================
275 __today__ 00:00:00.000 |
276 __today__ 00:00:00.000 |
277 __today__ 00:00:00.000 |
278 __today__ 00:00:00.000 |
279 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
280 ts1 | ts | f | g | 'a' | ts | f | g |
281 ============================================================================================================================================
282 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
283 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a | __today__ 00:00:01.000 | 102 | 1012 |
284 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a | __tomorrow__ 00:00:00.000 | 103 | 1013 |
285 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a | __tomorrow__ 00:00:02.000 | 104 | 1014 |
286 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
287 ts | f | g |
288 ======================================================
289 __today__ 00:00:00.000 | 101 | 1011 |
290 __today__ 00:00:01.000 | 102 | 1012 |
291 __tomorrow__ 00:00:00.000 | 103 | 1013 |
292 __tomorrow__ 00:00:02.000 | 104 | 1014 |
293 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on a.ts = b.ts;
294 ts1 | ts | f | g | 'a' |
295 ======================================================================================
296 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
297 __today__ 00:00:00.000 | __today__ 00:00:01.000 | 302 | 3012 | a |
298 __today__ 00:00:00.000 | __tomorrow__ 00:00:00.000 | 303 | 3013 | a |
299 __today__ 00:00:00.000 | __tomorrow__ 00:00:02.000 | 304 | 3014 | a |
300 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
301 c |
302 ======
303 a |
304 a |
305 a |
306 a |
307 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on a.ts = b.ts;
308 ts |
309 ==========================
310 __today__ 00:00:00.000 |
311 __today__ 00:00:01.000 |
312 __tomorrow__ 00:00:00.000 |
313 __tomorrow__ 00:00:02.000 |
314 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
315 ts1 | ts | f | g | 'a' | ts | f | g |
316 ============================================================================================================================================
317 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
318 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
319 ts | f | g |
320 ======================================================
321 __today__ 00:00:00.000 | 101 | 1011 |
322 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
323 ts1 | ts | f | g | 'a' |
324 ======================================================================================
325 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
326 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
327 c |
328 ======
329 a |
330 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts1 = a.ts and a.ts = b.ts;
331 ts |
332 ==========================
333 __today__ 00:00:00.000 |
334 taos> select * from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
335 ts1 | ts | f | g | 'a' | ts | f | g |
336 ============================================================================================================================================
337 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a | __today__ 00:00:00.000 | 101 | 1011 |
338 taos> select a.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
339 ts | f | g |
340 ======================================================
341 __today__ 00:00:00.000 | 101 | 1011 |
342 taos> select b.* from (select today() as ts1, ts, f, g, 'a' from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
343 ts1 | ts | f | g | 'a' |
344 ======================================================================================
345 __today__ 00:00:00.000 | __today__ 00:00:00.000 | 301 | 3011 | a |
346 taos> select b.c from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
347 c |
348 ======
349 a |
350 taos> select b.ts from (select today() as ts1, ts, f, g, 'a' c from b1) b left semi join a1 a on b.ts = a.ts and a.ts = b.ts1;
351 ts |
352 ==========================
353 __today__ 00:00:00.000 |
354 taos> select * from (select today() ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta on ta.ts=tb.ts and ta.tg1=tb.tg1;
355 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2;
356 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val;;
357 ts | val | tg2 | ts | val | tg2 |
358 ============================================================================================================
359 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
360 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
361 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
362 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
363 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
364 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
365 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
366 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
367 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=today() where tb.ts=today() order by tb.val;
368 ts | val | tg2 | ts | val | tg2 |
369 ============================================================================================================
370 __today__ 00:00:00.000 | 301 | 1 | __today__ 00:00:00.000 | 101 | 1 |
371 __today__ 00:00:00.000 | 302 | 1 | __today__ 00:00:00.000 | 101 | 1 |
372 __today__ 00:00:00.000 | 303 | 1 | __today__ 00:00:00.000 | 101 | 1 |
373 __today__ 00:00:00.000 | 304 | 1 | __today__ 00:00:00.000 | 101 | 1 |
374 __today__ 00:00:00.000 | 401 | 2 | __today__ 00:00:00.000 | 201 | 2 |
375 __today__ 00:00:00.000 | 402 | 2 | __today__ 00:00:00.000 | 201 | 2 |
376 __today__ 00:00:00.000 | 403 | 2 | __today__ 00:00:00.000 | 201 | 2 |
377 __today__ 00:00:00.000 | 404 | 2 | __today__ 00:00:00.000 | 201 | 2 |
378 taos> select * from (select today() ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb left semi join (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta on ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>today() where tb.ts>today();

View File

@ -147,35 +147,41 @@ class TDTestCase(TBase):
def test_nocheck_case(self):
tdLog.printNoPrefix(f"==========step:nocheck test")
tdSql.execute("select * from a1 a join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;")
#tdSql.execute("select * from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;")
#select b.* from a1 a join (select __const__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;
#select * from a1 a join (select __const__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
#select b.* from a1 a join (select __const__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;
#select * from (select __const__ as ts1, ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts;
#select b.* from (select __const__ as ts1, ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts;
#select * from a1 a , (select __const__ as ts1, ts, f, g, 'a' from b1) b where a.ts = b.ts;
#select b.* from a1 a , (select __const__ as ts1, ts, f, g, 'a' from b1) b where a.ts = b.ts;
#select * from (select __const__ as ts1, ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts;
#select b.* from (select __const__ as ts1, ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts;
tdSql.execute("select * from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;")
tdSql.execute("select b.* from a1 a join (select __const__ as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;")
tdSql.execute("select * from a1 a join (select __const__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;")
tdSql.execute("select b.* from a1 a join (select __const__ as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts;")
tdSql.execute("select * from (select __const__ as ts1, ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts;")
tdSql.execute("select b.* from (select __const__ as ts1, ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts;")
tdSql.execute("select * from a1 a , (select __const__ as ts1, ts, f, g, 'a' from b1) b where a.ts = b.ts;")
tdSql.execute("select b.* from a1 a , (select __const__ as ts1, ts, f, g, 'a' from b1) b where a.ts = b.ts;")
tdSql.execute("select * from (select __const__ as ts1, ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts;")
tdSql.execute("select b.* from (select __const__ as ts1, ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts;")
def test_abnormal_case(self):
tdLog.printNoPrefix(f"==========step:abnormal case test")
tdSql.error(f"select * from a1 a join (select '{self.today_ts}' as ts from b1) b on a.ts = b.ts;")
tdSql.error(f"select * from a1 a join (select '{self.today_ts}' + 1s as ts from b1) b on a.ts = b.ts;")
tdSql.error(f"select * from a1 a left asof join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts;")
tdSql.error(f"select * from a1 a left window join (select now as ts1, ts, f, g, 'a' c from b1) b window_offset(-1s, 1s);")
def run(self):
tdLog.debug(f"start to excute {__file__}")
self.insert_data()
self.test_today_case("inner")
self.test_now_case("inner")
self.test_constts_case("inner")
#self.test_today_case("inner")
#self.test_now_case("inner")
#self.test_constts_case("inner")
self.test_today_case("left_outer")
self.test_now_case("left_outer")
#self.test_today_case("left_outer")
#self.test_now_case("left_outer")
self.test_abnormal_case()
#self.test_today_case("full_outer")
#self.test_today_case("left_semi")
#self.test_today_case("left_anti")
#self.test_abnormal_case()
tdLog.success(f"{__file__} successfully executed")