mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
* fix: add more cases and fix issues * enh: add more test cases * enh: add more test cases * fix: memory leak issue * enh: add view cases and fix order by issue * enh: add document description
19 KiB
19 KiB
| 1 | taos> use test; |
|---|---|
| 2 | Database changed. |
| 3 | taos> select * from a1 a join (select now as ts, f, g, 'a' from b1) b on a.ts = b.ts; |
| 4 | taos> select * from a1 a join (select now as ts1, f, g, 'a' from b1) b on a.ts = b.ts1; |
| 5 | taos> select a.* from a1 a join (select now as ts, f, g, 'a' from b1) b on a.ts = b.ts; |
| 6 | taos> select b.* from a1 a join (select now as ts, f, g, 'a' from b1) b on a.ts = b.ts; |
| 7 | taos> select b.* from a1 a join (select now as ts1, f, g, 'a' from b1) b on a.ts = b.ts1; |
| 8 | taos> select a.*, b.ts from a1 a join (select now as ts1,ts, f, g, 'a' from b1) b on a.ts = b.ts1; |
| 9 | taos> select b.c from a1 a join (select now as ts, f, g, 'a' c from b1) b on a.ts = b.ts; |
| 10 | taos> select b.ts from a1 a join (select now as ts, f, g, 'a' c from b1) b on a.ts = b.ts; |
| 11 | taos> select * from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts; |
| 12 | taos> select a.* from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts; |
| 13 | taos> select b.* from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts; |
| 14 | taos> select b.c from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts; |
| 15 | taos> select a.* from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts; |
| 16 | ts | f | g | |
| 17 | ====================================================== |
| 18 | __today__ 00:00:00.000 | 101 | 1011 | |
| 19 | __today__ 00:00:01.000 | 102 | 1012 | |
| 20 | __tomorrow__ 00:00:00.000 | 103 | 1013 | |
| 21 | __tomorrow__ 00:00:02.000 | 104 | 1014 | |
| 22 | taos> select b.ts1,a.ts from a1 a join (select now as ts1, f, g, 'a' c from b1) b on b.ts1 = a.ts; |
| 23 | taos> select a.* from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on a.ts = b.ts; |
| 24 | ts | f | g | |
| 25 | ====================================================== |
| 26 | __today__ 00:00:00.000 | 101 | 1011 | |
| 27 | __today__ 00:00:01.000 | 102 | 1012 | |
| 28 | __tomorrow__ 00:00:00.000 | 103 | 1013 | |
| 29 | __tomorrow__ 00:00:02.000 | 104 | 1014 | |
| 30 | taos> select b.c from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts; |
| 31 | c | |
| 32 | ====== |
| 33 | a | |
| 34 | a | |
| 35 | a | |
| 36 | a | |
| 37 | taos> select b.ts from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on a.ts = b.ts; |
| 38 | ts | |
| 39 | ========================== |
| 40 | __today__ 00:00:00.000 | |
| 41 | __today__ 00:00:01.000 | |
| 42 | __tomorrow__ 00:00:00.000 | |
| 43 | __tomorrow__ 00:00:02.000 | |
| 44 | taos> select * from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts; |
| 45 | taos> select a.* from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts; |
| 46 | taos> select b.* from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts1 = a.ts and a.ts = b.ts; |
| 47 | taos> select b.c from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts; |
| 48 | taos> select b.ts from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts1 = a.ts and a.ts = b.ts; |
| 49 | taos> select * from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1; |
| 50 | taos> select a.* from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1; |
| 51 | taos> select b.* from a1 a join (select now as ts1, ts, f, g, 'a' from b1) b on b.ts = a.ts and a.ts = b.ts1; |
| 52 | taos> select b.c from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1; |
| 53 | taos> select b.ts from a1 a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1; |
| 54 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from a1 order by ts desc) a join (select now as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1; |
| 55 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from a1) a join (select now() as ts1, ts, f, g, 'a' c from b1) b on b.ts = a.ts and a.ts = b.ts1; |
| 56 | 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 join (select now 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; |
| 57 | 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 join (select now 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; |
| 58 | 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 join (select now 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 tb.val; |
| 59 | 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 join (select now 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=now where tb.ts=now order by tb.val; |
| 60 | 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 join (select now 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>now where tb.ts>now; |
| 61 | 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 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; |
| 62 | ts | val | tg2 | ts | val | tg2 | |
| 63 | ============================================================================================================ |
| 64 | __tomorrow__ 00:00:03.000 | 204 | 2 | __tomorrow__ 00:00:03.000 | 404 | 2 | |
| 65 | taos> select * from (select now as ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts; |
| 66 | taos> select * from (select now as ts1, f, g, 'a' from b1) b join a1 a on a.ts = b.ts1; |
| 67 | taos> select a.* from (select now as ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts; |
| 68 | taos> select b.* from (select now as ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts; |
| 69 | taos> select b.* from (select now as ts1, f, g, 'a' from b1) b join a1 a on a.ts = b.ts1; |
| 70 | taos> select b.c from (select now as ts, f, g, 'a' c from b1) b join a1 a on a.ts = b.ts; |
| 71 | taos> select b.ts from (select now as ts, f, g, 'a' c from b1) b join a1 a on a.ts = b.ts; |
| 72 | taos> select * from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts1 = a.ts; |
| 73 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts1 = a.ts; |
| 74 | taos> select b.* from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts1 = a.ts; |
| 75 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b join a1 a on b.ts1 = a.ts; |
| 76 | taos> select b.ts1 from (select now as ts1, f, g, 'a' c from b1) b join a1 a on b.ts1 = a.ts; |
| 77 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on a.ts = b.ts; |
| 78 | ts | f | g | |
| 79 | ====================================================== |
| 80 | __today__ 00:00:00.000 | 101 | 1011 | |
| 81 | __today__ 00:00:01.000 | 102 | 1012 | |
| 82 | __tomorrow__ 00:00:00.000 | 103 | 1013 | |
| 83 | __tomorrow__ 00:00:02.000 | 104 | 1014 | |
| 84 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b join a1 a on a.ts = b.ts; |
| 85 | c | |
| 86 | ====== |
| 87 | a | |
| 88 | a | |
| 89 | a | |
| 90 | a | |
| 91 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from b1) b join a1 a on a.ts = b.ts; |
| 92 | ts | |
| 93 | ========================== |
| 94 | __today__ 00:00:00.000 | |
| 95 | __today__ 00:00:01.000 | |
| 96 | __tomorrow__ 00:00:00.000 | |
| 97 | __tomorrow__ 00:00:02.000 | |
| 98 | taos> select * from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts1 = a.ts and a.ts = b.ts; |
| 99 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts1 = a.ts and a.ts = b.ts; |
| 100 | taos> select b.* from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts1 = a.ts and a.ts = b.ts; |
| 101 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b join a1 a on b.ts1 = a.ts and a.ts = b.ts; |
| 102 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from b1) b join a1 a on b.ts1 = a.ts and a.ts = b.ts; |
| 103 | taos> select * from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts = a.ts and a.ts = b.ts1; |
| 104 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts = a.ts and a.ts = b.ts1; |
| 105 | taos> select b.* from (select now as ts1, ts, f, g, 'a' from b1) b join a1 a on b.ts = a.ts and a.ts = b.ts1; |
| 106 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b join a1 a on b.ts = a.ts and a.ts = b.ts1; |
| 107 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from b1) b join a1 a on b.ts = a.ts and a.ts = b.ts1; |
| 108 | taos> select * from (select now ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb 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; |
| 109 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb 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; |
| 110 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb 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;; |
| 111 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb 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=now where tb.ts=now order by tb.val; |
| 112 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb 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>now where tb.ts>now; |
| 113 | taos> select * from a1 a , (select now as ts, f, g, 'a' from b1) b where a.ts = b.ts; |
| 114 | taos> select * from a1 a , (select now as ts1, f, g, 'a' from b1) b where a.ts = b.ts1; |
| 115 | taos> select a.* from a1 a , (select now as ts, f, g, 'a' from b1) b where a.ts = b.ts; |
| 116 | taos> select b.* from a1 a , (select now as ts, f, g, 'a' from b1) b where a.ts = b.ts; |
| 117 | taos> select b.c from a1 a , (select now as ts, f, g, 'a' c from b1) b where a.ts = b.ts; |
| 118 | taos> select b.ts from a1 a , (select now as ts, f, g, 'a' c from b1) b where a.ts = b.ts; |
| 119 | taos> select b.ts1 from a1 a , (select now as ts1, f, g, 'a' c from b1) b where a.ts = b.ts1; |
| 120 | taos> select * from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts1 = a.ts; |
| 121 | taos> select a.* from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts1 = a.ts; |
| 122 | taos> select b.* from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts1 = a.ts; |
| 123 | taos> select b.c from a1 a , (select now as ts1, ts, f, g, 'a' c from b1) b where b.ts1 = a.ts; |
| 124 | taos> select b.ts1 from a1 a , (select now as ts1, f, g, 'a' c from b1) b where b.ts1 = a.ts; |
| 125 | taos> select a.* from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where a.ts = b.ts; |
| 126 | ts | f | g | |
| 127 | ====================================================== |
| 128 | __today__ 00:00:00.000 | 101 | 1011 | |
| 129 | __today__ 00:00:01.000 | 102 | 1012 | |
| 130 | __tomorrow__ 00:00:00.000 | 103 | 1013 | |
| 131 | __tomorrow__ 00:00:02.000 | 104 | 1014 | |
| 132 | taos> select b.c from a1 a , (select now as ts1, ts, f, g, 'a' c from b1) b where a.ts = b.ts; |
| 133 | c | |
| 134 | ====== |
| 135 | a | |
| 136 | a | |
| 137 | a | |
| 138 | a | |
| 139 | taos> select b.ts from a1 a , (select now as ts1, ts, f, g, 'a' c from b1) b where a.ts = b.ts; |
| 140 | ts | |
| 141 | ========================== |
| 142 | __today__ 00:00:00.000 | |
| 143 | __today__ 00:00:01.000 | |
| 144 | __tomorrow__ 00:00:00.000 | |
| 145 | __tomorrow__ 00:00:02.000 | |
| 146 | taos> select * from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts1 = a.ts and a.ts = b.ts; |
| 147 | taos> select a.* from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts1 = a.ts and a.ts = b.ts; |
| 148 | taos> select b.* from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts1 = a.ts and a.ts = b.ts; |
| 149 | taos> select b.c from a1 a , (select now as ts1, ts, f, g, 'a' c from b1) b where b.ts1 = a.ts and a.ts = b.ts; |
| 150 | taos> select b.ts from a1 a , (select now as ts1, ts, f, g, 'a' c from b1) b where b.ts1 = a.ts and a.ts = b.ts; |
| 151 | taos> select * from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts = a.ts and a.ts = b.ts1; |
| 152 | taos> select a.* from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts = a.ts and a.ts = b.ts1; |
| 153 | taos> select b.* from a1 a , (select now as ts1, ts, f, g, 'a' from b1) b where b.ts = a.ts and a.ts = b.ts1; |
| 154 | taos> select b.c from a1 a , (select now as ts1, ts, f, g, 'a' c from b1) b where b.ts = a.ts and a.ts = b.ts1; |
| 155 | taos> select b.ts from a1 a , (select now as ts1, ts, f, g, 'a' c from b1) b where b.ts = a.ts and a.ts = b.ts1; |
| 156 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from a1) a , (select now as ts1, ts, f, g, 'a' c from b1) b where b.ts = a.ts and a.ts = b.ts1; |
| 157 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from a1 order by ts) a , (select now as ts1, ts, f, g, 'a' c from b1) b where b.ts = a.ts and a.ts = b.ts1; |
| 158 | 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 , (select now ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb where ta.ts=tb.ts and ta.tg1=tb.tg1; |
| 159 | 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 , (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb where ta.ts=tb.ts and ta.tg2=tb.tg2; |
| 160 | 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 , (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb where ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val; |
| 161 | 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 , (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb where ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=now order by tb.val; |
| 162 | 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 , (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb where ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>now ; |
| 163 | taos> select * from (select now as ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts; |
| 164 | taos> select * from (select now as ts1, f, g, 'a' from b1) b , a1 a where a.ts = b.ts1; |
| 165 | taos> select a.* from (select now as ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts; |
| 166 | taos> select b.* from (select now as ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts; |
| 167 | taos> select b.c from (select now as ts, f, g, 'a' c from b1) b , a1 a where a.ts = b.ts; |
| 168 | taos> select b.ts from (select now as ts, f, g, 'a' c from b1) b , a1 a where a.ts = b.ts; |
| 169 | taos> select b.ts1 from (select now as ts1, f, g, 'a' c from b1) b , a1 a where a.ts = b.ts1; |
| 170 | taos> select * from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts1 = a.ts; |
| 171 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts1 = a.ts; |
| 172 | taos> select b.* from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts1 = a.ts; |
| 173 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b , a1 a where b.ts1 = a.ts; |
| 174 | taos> select b.ts1 from (select now as ts1, f, g, 'a' c from b1) b , a1 a where b.ts1 = a.ts; |
| 175 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where a.ts = b.ts; |
| 176 | ts | f | g | |
| 177 | ====================================================== |
| 178 | __today__ 00:00:00.000 | 101 | 1011 | |
| 179 | __today__ 00:00:01.000 | 102 | 1012 | |
| 180 | __tomorrow__ 00:00:00.000 | 103 | 1013 | |
| 181 | __tomorrow__ 00:00:02.000 | 104 | 1014 | |
| 182 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b , a1 a where a.ts = b.ts; |
| 183 | c | |
| 184 | ====== |
| 185 | a | |
| 186 | a | |
| 187 | a | |
| 188 | a | |
| 189 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from b1) b , a1 a where a.ts = b.ts; |
| 190 | ts | |
| 191 | ========================== |
| 192 | __today__ 00:00:00.000 | |
| 193 | __today__ 00:00:01.000 | |
| 194 | __tomorrow__ 00:00:00.000 | |
| 195 | __tomorrow__ 00:00:02.000 | |
| 196 | taos> select * from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts1 = a.ts and a.ts = b.ts; |
| 197 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts1 = a.ts and a.ts = b.ts; |
| 198 | taos> select b.* from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts1 = a.ts and a.ts = b.ts; |
| 199 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b , a1 a where b.ts1 = a.ts and a.ts = b.ts; |
| 200 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from b1) b , a1 a where b.ts1 = a.ts and a.ts = b.ts; |
| 201 | taos> select * from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts = a.ts and a.ts = b.ts1; |
| 202 | taos> select a.* from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts = a.ts and a.ts = b.ts1; |
| 203 | taos> select b.* from (select now as ts1, ts, f, g, 'a' from b1) b , a1 a where b.ts = a.ts and a.ts = b.ts1; |
| 204 | taos> select b.c from (select now as ts1, ts, f, g, 'a' c from b1) b , a1 a where b.ts = a.ts and a.ts = b.ts1; |
| 205 | taos> select b.ts from (select now as ts1, ts, f, g, 'a' c from b1) b , a1 a where b.ts = a.ts and a.ts = b.ts1; |
| 206 | taos> select * from (select now ts, last(f) val, tg1 from stb where tg1 >= 0 partition by tg1 order by ts) tb , (select last(ts) as `ts`,last(f) as `val`,tg1 from sta where tg1=1 partition by tg1 order by ts) ta where ta.ts=tb.ts and ta.tg1=tb.tg1; |
| 207 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 order by ts) tb , (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 order by ts) ta where ta.ts=tb.ts and ta.tg2=tb.tg2; |
| 208 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts) tb , (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta where ta.ts=tb.ts and ta.tg2=tb.tg2 order by tb.val; |
| 209 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb , (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta where ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts=now order by tb.val; |
| 210 | taos> select * from (select now ts, last(f) val, tg2 from stb where tg2 >= 0 partition by tg2 interval(1s) order by ts desc) tb , (select last(ts) as `ts`,last(f) as `val`,tg2 from sta where tg2>0 partition by tg2 interval(1s) order by ts) ta where ta.ts=tb.ts and ta.tg2=tb.tg2 and tb.ts>now ; |