fix: add more test cases
This commit is contained in:
parent
a4ed19b36d
commit
ad4b278162
|
@ -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;
|
||||
|
|
|
@ -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__;
|
||||
|
||||
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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__;
|
||||
|
||||
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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__;
|
||||
|
||||
|
|
@ -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();
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue