mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
68 KiB
68 KiB
| 1 | taos> alter local 'compareAsStrInGreatest' '1'; |
|---|---|
| 2 | taos> select GREATEST(1,2,3,4,5,6,7,8,9,10); |
| 3 | greatest(1,2,3,4,5,6,7,8,9,10) | |
| 4 | ================================= |
| 5 | 10 | |
| 6 | taos> select GREATEST(1,1.1,2.23,3.4444,5.66666666,6.21241241,7.999999999999); |
| 7 | greatest(1,1.1,2.23,3.4444,5.66666666,6.21241241,7.999999999999) | |
| 8 | =================================================================== |
| 9 | 7.999999999999 | |
| 10 | taos> select GREATEST(1,'2',3.3,4.4,5); |
| 11 | greatest(1,'2',3.3,4.4,5) | |
| 12 | ============================ |
| 13 | 5 | |
| 14 | taos> select GREATEST(121,'18'); |
| 15 | greatest(121,'18') | |
| 16 | ============================ |
| 17 | 18 | |
| 18 | taos> select GREATEST(18888,'18'); |
| 19 | greatest(18888,'18') | |
| 20 | ============================ |
| 21 | 18888 | |
| 22 | taos> select GREATEST(1,2,3,4,5,'5.1'); |
| 23 | greatest(1,2,3,4,5,'5.1') | |
| 24 | ============================ |
| 25 | 5.1 | |
| 26 | taos> select GREATEST('1','2','3','4',5); |
| 27 | greatest('1','2','3','4',5) | |
| 28 | ============================== |
| 29 | 5 | |
| 30 | taos> select GREATEST('1','2','3','4','5'); |
| 31 | greatest('1','2','3','4','5') | |
| 32 | ================================ |
| 33 | 5 | |
| 34 | taos> select GREATEST(1,2,3,4,5,6,7,'a','b','一','二','三'); |
| 35 | greatest(1,2,3,4,5,6,7,'a','b','一','二','三') | |
| 36 | ==================================================== |
| 37 | 二 | |
| 38 | taos> select GREATEST(1,2,3,4,5,6,7,'a','b','c','1','2','1231213'); |
| 39 | greatest(1,2,3,4,5,6,7,'a','b','c','1','2','1231213') | |
| 40 | ======================================================== |
| 41 | c | |
| 42 | taos> select GREATEST(1,2,3,4,5,6,7,'a','b','c','1','2','1231213','1231213.123123'); |
| 43 | greatest(1,2,3,4,5,6,7,'a','b','c','1','2','1231213','1231213.12 | |
| 44 | =================================================================== |
| 45 | c | |
| 46 | taos> select GREATEST(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint), cast(3 as int), cast(4 as bigint), cast(5 as float), cast(6 as double), cast(8 as varchar(20)), cast(9 as nchar(20))); |
| 47 | greatest(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint | |
| 48 | =================================================================== |
| 49 | 9 | |
| 50 | taos> select GREATEST(cast(0 as bool), cast(1 as tinyint unsigned), cast(2 as smallint unsigned), cast(3 as int unsigned), cast(4 as bigint unsigned), cast(5 as float), cast(6 as double), cast(8 as varchar(20)), cast(9 as nchar(20))); |
| 51 | greatest(cast(0 as bool), cast(1 as tinyint unsigned), cast(2 as | |
| 52 | =================================================================== |
| 53 | 9 | |
| 54 | taos> select GREATEST(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint), cast(3 as int), cast(4 as bigint), cast(5 as float), cast(6 as double), cast(8 as varchar(20)), cast(9 as nchar(20)), cast(0 as bool), cast(1 as tinyint unsigned), cast(2 as smallint unsigned), cast(3 as int unsigned), cast(4 as bigint unsigned), cast(5 as float), cast(6 as double)); |
| 55 | greatest(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint | |
| 56 | =================================================================== |
| 57 | 9 | |
| 58 | taos> select GREATEST(cast(100 as tinyint), cast(101 as tinyint)); |
| 59 | greatest(cast(100 as tinyint), cast(101 as tinyint)) | |
| 60 | ======================================================= |
| 61 | 101 | |
| 62 | taos> select GREATEST(cast(100 as tinyint), cast(101 as smallint)); |
| 63 | greatest(cast(100 as tinyint), cast(101 as smallint)) | |
| 64 | ======================================================== |
| 65 | 101 | |
| 66 | taos> select GREATEST(cast(100 as tinyint), cast(101 as int)); |
| 67 | greatest(cast(100 as tinyint), cast(101 as int)) | |
| 68 | =================================================== |
| 69 | 101 | |
| 70 | taos> select GREATEST(cast(100 as tinyint), cast(101 as bigint)); |
| 71 | greatest(cast(100 as tinyint), cast(101 as bigint)) | |
| 72 | ====================================================== |
| 73 | 101 | |
| 74 | taos> select GREATEST(cast(100 as tinyint), cast(101 as float)); |
| 75 | greatest(cast(100 as tinyint), cast(101 as float)) | |
| 76 | ===================================================== |
| 77 | 101 | |
| 78 | taos> select GREATEST(cast(100 as tinyint), cast(101 as double)); |
| 79 | greatest(cast(100 as tinyint), cast(101 as double)) | |
| 80 | ====================================================== |
| 81 | 101 | |
| 82 | taos> select GREATEST(cast(100 as tinyint), cast(101 as varchar(20))); |
| 83 | greatest(cast(100 as tinyint), cast(101 as varchar(20))) | |
| 84 | =========================================================== |
| 85 | 101 | |
| 86 | taos> select GREATEST(cast(100 as tinyint), cast(101 as nchar(20))); |
| 87 | greatest(cast(100 as tinyint), cast(101 as nchar(20))) | |
| 88 | ========================================================= |
| 89 | 101 | |
| 90 | taos> select GREATEST(cast(101 as tinyint), cast(100 as tinyint)); |
| 91 | greatest(cast(101 as tinyint), cast(100 as tinyint)) | |
| 92 | ======================================================= |
| 93 | 101 | |
| 94 | taos> select GREATEST(cast(101 as tinyint), cast(100 as smallint)); |
| 95 | greatest(cast(101 as tinyint), cast(100 as smallint)) | |
| 96 | ======================================================== |
| 97 | 101 | |
| 98 | taos> select GREATEST(cast(101 as tinyint), cast(100 as int)); |
| 99 | greatest(cast(101 as tinyint), cast(100 as int)) | |
| 100 | =================================================== |
| 101 | 101 | |
| 102 | taos> select GREATEST(cast(101 as tinyint), cast(100 as bigint)); |
| 103 | greatest(cast(101 as tinyint), cast(100 as bigint)) | |
| 104 | ====================================================== |
| 105 | 101 | |
| 106 | taos> select GREATEST(cast(101 as tinyint), cast(100 as float)); |
| 107 | greatest(cast(101 as tinyint), cast(100 as float)) | |
| 108 | ===================================================== |
| 109 | 101 | |
| 110 | taos> select GREATEST(cast(101 as tinyint), cast(100 as double)); |
| 111 | greatest(cast(101 as tinyint), cast(100 as double)) | |
| 112 | ====================================================== |
| 113 | 101 | |
| 114 | taos> select GREATEST(cast(101 as tinyint), cast(100 as varchar(20))); |
| 115 | greatest(cast(101 as tinyint), cast(100 as varchar(20))) | |
| 116 | =========================================================== |
| 117 | 101 | |
| 118 | taos> select GREATEST(cast(101 as tinyint), cast(100 as nchar(20))); |
| 119 | greatest(cast(101 as tinyint), cast(100 as nchar(20))) | |
| 120 | ========================================================= |
| 121 | 101 | |
| 122 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as smallint)); |
| 123 | greatest(cast(1000 as smallint), cast(1001 as smallint)) | |
| 124 | =========================================================== |
| 125 | 1001 | |
| 126 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as int)); |
| 127 | greatest(cast(1000 as smallint), cast(1001 as int)) | |
| 128 | ====================================================== |
| 129 | 1001 | |
| 130 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as bigint)); |
| 131 | greatest(cast(1000 as smallint), cast(1001 as bigint)) | |
| 132 | ========================================================= |
| 133 | 1001 | |
| 134 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as float)); |
| 135 | greatest(cast(1000 as smallint), cast(1001 as float)) | |
| 136 | ======================================================== |
| 137 | 1001 | |
| 138 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as double)); |
| 139 | greatest(cast(1000 as smallint), cast(1001 as double)) | |
| 140 | ========================================================= |
| 141 | 1001 | |
| 142 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as varchar(20))); |
| 143 | greatest(cast(1000 as smallint), cast(1001 as varchar(20))) | |
| 144 | ============================================================== |
| 145 | 1001 | |
| 146 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as nchar(20))); |
| 147 | greatest(cast(1000 as smallint), cast(1001 as nchar(20))) | |
| 148 | ============================================================ |
| 149 | 1001 | |
| 150 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as smallint)); |
| 151 | greatest(cast(1001 as smallint), cast(1000 as smallint)) | |
| 152 | =========================================================== |
| 153 | 1001 | |
| 154 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as int)); |
| 155 | greatest(cast(1001 as smallint), cast(1000 as int)) | |
| 156 | ====================================================== |
| 157 | 1001 | |
| 158 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as bigint)); |
| 159 | greatest(cast(1001 as smallint), cast(1000 as bigint)) | |
| 160 | ========================================================= |
| 161 | 1001 | |
| 162 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as float)); |
| 163 | greatest(cast(1001 as smallint), cast(1000 as float)) | |
| 164 | ======================================================== |
| 165 | 1001 | |
| 166 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as double)); |
| 167 | greatest(cast(1001 as smallint), cast(1000 as double)) | |
| 168 | ========================================================= |
| 169 | 1001 | |
| 170 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as varchar(20))); |
| 171 | greatest(cast(1001 as smallint), cast(1000 as varchar(20))) | |
| 172 | ============================================================== |
| 173 | 1001 | |
| 174 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as nchar(20))); |
| 175 | greatest(cast(1001 as smallint), cast(1000 as nchar(20))) | |
| 176 | ============================================================ |
| 177 | 1001 | |
| 178 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as int)); |
| 179 | greatest(cast(1000000 as int), cast(1000001 as int)) | |
| 180 | ======================================================= |
| 181 | 1000001 | |
| 182 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as bigint)); |
| 183 | greatest(cast(1000000 as int), cast(1000001 as bigint)) | |
| 184 | ========================================================== |
| 185 | 1000001 | |
| 186 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as float)); |
| 187 | greatest(cast(1000000 as int), cast(1000001 as float)) | |
| 188 | ========================================================= |
| 189 | 1e+06 | |
| 190 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as double)); |
| 191 | greatest(cast(1000000 as int), cast(1000001 as double)) | |
| 192 | ========================================================== |
| 193 | 1000001 | |
| 194 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as varchar(20))); |
| 195 | greatest(cast(1000000 as int), cast(1000001 as varchar(20))) | |
| 196 | =============================================================== |
| 197 | 1000001 | |
| 198 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as nchar(20))); |
| 199 | greatest(cast(1000000 as int), cast(1000001 as nchar(20))) | |
| 200 | ============================================================= |
| 201 | 1000001 | |
| 202 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as int)); |
| 203 | greatest(cast(1000001 as int), cast(1000000 as int)) | |
| 204 | ======================================================= |
| 205 | 1000001 | |
| 206 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as bigint)); |
| 207 | greatest(cast(1000001 as int), cast(1000000 as bigint)) | |
| 208 | ========================================================== |
| 209 | 1000001 | |
| 210 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as float)); |
| 211 | greatest(cast(1000001 as int), cast(1000000 as float)) | |
| 212 | ========================================================= |
| 213 | 1e+06 | |
| 214 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as double)); |
| 215 | greatest(cast(1000001 as int), cast(1000000 as double)) | |
| 216 | ========================================================== |
| 217 | 1000001 | |
| 218 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as varchar(20))); |
| 219 | greatest(cast(1000001 as int), cast(1000000 as varchar(20))) | |
| 220 | =============================================================== |
| 221 | 1000001 | |
| 222 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as nchar(20))); |
| 223 | greatest(cast(1000001 as int), cast(1000000 as nchar(20))) | |
| 224 | ============================================================= |
| 225 | 1000001 | |
| 226 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as bigint)); |
| 227 | greatest(cast(1000000000 as bigint), cast(1000000001 as bigint)) | |
| 228 | =================================================================== |
| 229 | 1000000001 | |
| 230 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as float)); |
| 231 | greatest(cast(1000000000 as bigint), cast(1000000001 as float)) | |
| 232 | ================================================================== |
| 233 | 1e+09 | |
| 234 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as double)); |
| 235 | greatest(cast(1000000000 as bigint), cast(1000000001 as double)) | |
| 236 | =================================================================== |
| 237 | 1000000001 | |
| 238 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as varchar(20))); |
| 239 | greatest(cast(1000000000 as bigint), cast(1000000001 as varchar( | |
| 240 | =================================================================== |
| 241 | 1000000001 | |
| 242 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as nchar(20))); |
| 243 | greatest(cast(1000000000 as bigint), cast(1000000001 as nchar(20 | |
| 244 | =================================================================== |
| 245 | 1000000001 | |
| 246 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as bigint)); |
| 247 | greatest(cast(1000000001 as bigint), cast(1000000000 as bigint)) | |
| 248 | =================================================================== |
| 249 | 1000000001 | |
| 250 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as float)); |
| 251 | greatest(cast(1000000001 as bigint), cast(1000000000 as float)) | |
| 252 | ================================================================== |
| 253 | 1e+09 | |
| 254 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as double)); |
| 255 | greatest(cast(1000000001 as bigint), cast(1000000000 as double)) | |
| 256 | =================================================================== |
| 257 | 1000000001 | |
| 258 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as varchar(20))); |
| 259 | greatest(cast(1000000001 as bigint), cast(1000000000 as varchar( | |
| 260 | =================================================================== |
| 261 | 1000000001 | |
| 262 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as nchar(20))); |
| 263 | greatest(cast(1000000001 as bigint), cast(1000000000 as nchar(20 | |
| 264 | =================================================================== |
| 265 | 1000000001 | |
| 266 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as float)); |
| 267 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as f | |
| 268 | =================================================================== |
| 269 | 100001 | |
| 270 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as double)); |
| 271 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as d | |
| 272 | =================================================================== |
| 273 | 100001.1111111 | |
| 274 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as timestamp)); |
| 275 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as t | |
| 276 | =================================================================== |
| 277 | 100001 | |
| 278 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as varchar(20))); |
| 279 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as v | |
| 280 | =================================================================== |
| 281 | 100001.1111111 | |
| 282 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as nchar(20))); |
| 283 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as n | |
| 284 | =================================================================== |
| 285 | 100001.1111111 | |
| 286 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as float)); |
| 287 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as f | |
| 288 | =================================================================== |
| 289 | 100001 | |
| 290 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as double)); |
| 291 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as d | |
| 292 | =================================================================== |
| 293 | 100001.109375 | |
| 294 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as timestamp)); |
| 295 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as t | |
| 296 | =================================================================== |
| 297 | 100001 | |
| 298 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as varchar(20))); |
| 299 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as v | |
| 300 | =================================================================== |
| 301 | 100001.109375 | |
| 302 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as nchar(20))); |
| 303 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as n | |
| 304 | =================================================================== |
| 305 | 100001.109375 | |
| 306 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as double)); |
| 307 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 308 | =================================================================== |
| 309 | 100001.1111111 | |
| 310 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as timestamp)); |
| 311 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 312 | =================================================================== |
| 313 | 100001 | |
| 314 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as varchar(20))); |
| 315 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 316 | =================================================================== |
| 317 | 100001.1111111 | |
| 318 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as nchar(20))); |
| 319 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 320 | =================================================================== |
| 321 | 100001.1111111 | |
| 322 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as double)); |
| 323 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 324 | =================================================================== |
| 325 | 100001.1111111 | |
| 326 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as timestamp)); |
| 327 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 328 | =================================================================== |
| 329 | 100001.1111111 | |
| 330 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as varchar(20))); |
| 331 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 332 | =================================================================== |
| 333 | 100001.111111 | |
| 334 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as nchar(20))); |
| 335 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 336 | =================================================================== |
| 337 | 100001.111111 | |
| 338 | taos> select GREATEST(cast('中文测试' as varchar(20)), cast('中文测试一' as varchar(20))); |
| 339 | greatest(cast('中文测试' as varchar(20)), cast('中文测试 | |
| 340 | =================================================================== |
| 341 | 中文测试一 | |
| 342 | taos> select GREATEST(cast('中文测试' as varchar(20)), cast('中文测试一' as nchar(20))); |
| 343 | greatest(cast('中文测试' as varchar(20)), cast('中文测试 | |
| 344 | =================================================================== |
| 345 | 中文测试一 | |
| 346 | taos> select GREATEST(cast('中文测试一' as varchar(20)), cast('中文测试' as varchar(20))); |
| 347 | greatest(cast('中文测试一' as varchar(20)), cast('中文测 | |
| 348 | =================================================================== |
| 349 | 中文测试一 | |
| 350 | taos> select GREATEST(cast('中文测试一' as varchar(20)), cast('中文测试' as nchar(20))); |
| 351 | greatest(cast('中文测试一' as varchar(20)), cast('中文测 | |
| 352 | =================================================================== |
| 353 | 中文测试一 | |
| 354 | taos> select GREATEST(cast('abc123abc' as varchar(20)), cast('abc124abc' as varchar(20))); |
| 355 | greatest(cast('abc123abc' as varchar(20)), cast('abc124abc' as v | |
| 356 | =================================================================== |
| 357 | abc124abc | |
| 358 | taos> select GREATEST(cast('abc123abc' as varchar(20)), cast('abc124abc' as nchar(20))); |
| 359 | greatest(cast('abc123abc' as varchar(20)), cast('abc124abc' as n | |
| 360 | =================================================================== |
| 361 | abc124abc | |
| 362 | taos> select GREATEST(cast('abc124abc' as varchar(20)), cast('abc123abc' as varchar(20))); |
| 363 | greatest(cast('abc124abc' as varchar(20)), cast('abc123abc' as v | |
| 364 | =================================================================== |
| 365 | abc124abc | |
| 366 | taos> select GREATEST(cast('abc124abc' as varchar(20)), cast('abc123abc' as nchar(20))); |
| 367 | greatest(cast('abc124abc' as varchar(20)), cast('abc123abc' as n | |
| 368 | =================================================================== |
| 369 | abc124abc | |
| 370 | taos> select GREATEST(cast('abc123abc' as nchar(20)), cast('abc124abc' as nchar(20))); |
| 371 | greatest(cast('abc123abc' as nchar(20)), cast('abc124abc' as nch | |
| 372 | =================================================================== |
| 373 | abc124abc | |
| 374 | taos> select GREATEST(cast(100 as tinyint), cast(101 as float), cast(102 as varchar(20))); |
| 375 | greatest(cast(100 as tinyint), cast(101 as float), cast(102 as v | |
| 376 | =================================================================== |
| 377 | 102 | |
| 378 | taos> select GREATEST(cast(100 as float), cast(101 as tinyint), cast(102 as varchar(20))); |
| 379 | greatest(cast(100 as float), cast(101 as tinyint), cast(102 as v | |
| 380 | =================================================================== |
| 381 | 102 | |
| 382 | taos> select GREATEST(cast(100 as float), cast(101 as varchar(20)), cast(102 as tinyint)); |
| 383 | greatest(cast(100 as float), cast(101 as varchar(20)), cast(102 | |
| 384 | =================================================================== |
| 385 | 102 | |
| 386 | taos> select GREATEST(cast(100 as varchar(20)), cast(101 as float), cast(102 as tinyint)); |
| 387 | greatest(cast(100 as varchar(20)), cast(101 as float), cast(102 | |
| 388 | =================================================================== |
| 389 | 102 | |
| 390 | taos> select GREATEST('a','b','c','d','e','f','g','h','1231','15155'); |
| 391 | greatest('a','b','c','d','e','f','g','h','1231','15155') | |
| 392 | =========================================================== |
| 393 | h | |
| 394 | taos> select GREATEST(current, voltage, phase, id, nch1, nch2, var1, var2) from ts_4893.meters order by ts limit 10; |
| 395 | greatest(current, voltage, phase, id, nch1, nch2, var1, var2) | |
| 396 | ================================================================ |
| 397 | 四 | |
| 398 | 三a | |
| 399 | 四 | |
| 400 | 一 | |
| 401 | 一二三四五六七八九十 | |
| 402 | 一二三 | |
| 403 | prision | |
| 404 | 一二三四五六七八九十 | |
| 405 | prision | |
| 406 | 一 | |
| 407 | taos> select GREATEST(current, voltage, phase, id) from ts_4893.meters order by ts limit 10; |
| 408 | greatest(current, voltage, phase, id) | |
| 409 | ======================================== |
| 410 | 221 | |
| 411 | 220 | |
| 412 | 215 | |
| 413 | 216 | |
| 414 | 219 | |
| 415 | 221 | |
| 416 | 215 | |
| 417 | 217 | |
| 418 | 216 | |
| 419 | 223 | |
| 420 | taos> select GREATEST(nch1, nch2, var1, var2) from ts_4893.meters order by ts limit 10; |
| 421 | greatest(nch1, nch2, var1, var2) | |
| 422 | =================================== |
| 423 | 四 | |
| 424 | 三a | |
| 425 | 四 | |
| 426 | 一 | |
| 427 | 一二三四五六七八九十 | |
| 428 | 一二三 | |
| 429 | prision | |
| 430 | 一二三四五六七八九十 | |
| 431 | prision | |
| 432 | 一 | |
| 433 | taos> select GREATEST(221, voltage) from ts_4893.meters order by ts limit 10; |
| 434 | greatest(221, voltage) | |
| 435 | ========================= |
| 436 | 221 | |
| 437 | 221 | |
| 438 | 221 | |
| 439 | 221 | |
| 440 | 221 | |
| 441 | 221 | |
| 442 | 221 | |
| 443 | 221 | |
| 444 | 221 | |
| 445 | 223 | |
| 446 | taos> select GREATEST(5, id) from ts_4893.meters order by ts limit 10; |
| 447 | greatest(5, id) | |
| 448 | ======================== |
| 449 | 5 | |
| 450 | 5 | |
| 451 | 5 | |
| 452 | 5 | |
| 453 | 5 | |
| 454 | 5 | |
| 455 | 6 | |
| 456 | 7 | |
| 457 | 8 | |
| 458 | 9 | |
| 459 | taos> select GREATEST('r', nch1) from ts_4893.meters order by ts limit 10; |
| 460 | greatest('r', nch1) | |
| 461 | ================================= |
| 462 | r | |
| 463 | 一二三四五六七八九十 | |
| 464 | update | |
| 465 | r | |
| 466 | r | |
| 467 | r | |
| 468 | r | |
| 469 | 一二三四五六七八九十 | |
| 470 | r | |
| 471 | r | |
| 472 | taos> select GREATEST('r', nch1, nch2) from ts_4893.meters order by ts limit 10; |
| 473 | greatest('r', nch1, nch2) | |
| 474 | ================================= |
| 475 | 四 | |
| 476 | 一二三四五六七八九十 | |
| 477 | update | |
| 478 | 一 | |
| 479 | r | |
| 480 | 一二三 | |
| 481 | r | |
| 482 | 一二三四五六七八九十 | |
| 483 | r | |
| 484 | r | |
| 485 | taos> select GREATEST('r', var1) from ts_4893.meters order by ts limit 10; |
| 486 | greatest('r', var1) | |
| 487 | ================================= |
| 488 | r | |
| 489 | r | |
| 490 | r | |
| 491 | r | |
| 492 | 一二三四五六七八九十 | |
| 493 | update | |
| 494 | r | |
| 495 | r | |
| 496 | r | |
| 497 | r | |
| 498 | taos> select GREATEST('r', var1, var2) from ts_4893.meters order by ts limit 10; |
| 499 | greatest('r', var1, var2) | |
| 500 | ================================= |
| 501 | r | |
| 502 | 三a | |
| 503 | 四 | |
| 504 | r | |
| 505 | 一二三四五六七八九十 | |
| 506 | update | |
| 507 | r | |
| 508 | r | |
| 509 | r | |
| 510 | 一 | |
| 511 | taos> select GREATEST('二中文测试', nch1) from ts_4893.meters order by ts limit 10; |
| 512 | greatest('二中文测试', nch1) | |
| 513 | ==================================== |
| 514 | 二中文测试 | |
| 515 | 二中文测试 | |
| 516 | 二中文测试 | |
| 517 | 二中文测试 | |
| 518 | 二中文测试 | |
| 519 | 二中文测试 | |
| 520 | 二中文测试 | |
| 521 | 二中文测试 | |
| 522 | 二中文测试 | |
| 523 | 二中文测试 | |
| 524 | taos> select GREATEST('二中文测试', nch1, nch2) from ts_4893.meters order by ts limit 10; |
| 525 | greatest('二中文测试', nch1, nch2) | |
| 526 | ========================================== |
| 527 | 四 | |
| 528 | 二中文测试 | |
| 529 | 二中文测试 | |
| 530 | 二中文测试 | |
| 531 | 二中文测试 | |
| 532 | 二中文测试 | |
| 533 | 二中文测试 | |
| 534 | 二中文测试 | |
| 535 | 二中文测试 | |
| 536 | 二中文测试 | |
| 537 | taos> select GREATEST('二中文测试', var1) from ts_4893.meters order by ts limit 10; |
| 538 | greatest('二中文测试', var1) | |
| 539 | ==================================== |
| 540 | 二中文测试 | |
| 541 | 二中文测试 | |
| 542 | 二中文测试 | |
| 543 | 二中文测试 | |
| 544 | 二中文测试 | |
| 545 | 二中文测试 | |
| 546 | 二中文测试 | |
| 547 | 二中文测试 | |
| 548 | 二中文测试 | |
| 549 | 二中文测试 | |
| 550 | taos> select GREATEST('二中文测试', var1, var2) from ts_4893.meters order by ts limit 10; |
| 551 | greatest('二中文测试', var1, var2) | |
| 552 | ========================================== |
| 553 | 二中文测试 | |
| 554 | 二中文测试 | |
| 555 | 四 | |
| 556 | 二中文测试 | |
| 557 | 二中文测试 | |
| 558 | 二中文测试 | |
| 559 | 二中文测试 | |
| 560 | 二中文测试 | |
| 561 | 二中文测试 | |
| 562 | 二中文测试 | |
| 563 | taos> select GREATEST('23', 3443434343434343); |
| 564 | greatest('23', 3443434343434343) | |
| 565 | =================================== |
| 566 | 3443434343434343 | |
| 567 | taos> select GREATEST(co, 3443434343434343) from ts_4893.n1; |
| 568 | greatest(co, 3443434343434343) | |
| 569 | ================================= |
| 570 | 3443434343434343 | |
| 571 | 3443434343434343 | |
| 572 | 3443434343434343 | |
| 573 | taos> select GREATEST('23', 3443434343434343) from ts_4893.n1; |
| 574 | greatest('23', 3443434343434343) | |
| 575 | =================================== |
| 576 | 3443434343434343 | |
| 577 | 3443434343434343 | |
| 578 | 3443434343434343 | |
| 579 | taos> select GREATEST('23', 1443434343434343) from ts_4893.n1; |
| 580 | greatest('23', 1443434343434343) | |
| 581 | =================================== |
| 582 | 23 | |
| 583 | 23 | |
| 584 | 23 | |
| 585 | taos> select GREATEST(current, voltage) from ts_4893.n1; |
| 586 | greatest(current, voltage) | |
| 587 | ============================= |
| 588 | NULL | |
| 589 | NULL | |
| 590 | 5 | |
| 591 | taos> select GREATEST(current, voltage, '15') from ts_4893.n1; |
| 592 | greatest(current, voltage, '15') | |
| 593 | =================================== |
| 594 | NULL | |
| 595 | NULL | |
| 596 | 5.000000 | |
| 597 | taos> alter local 'compareAsStrInGreatest' '0'; |
| 598 | taos> select GREATEST(1,'2',3.3,4.4,5); |
| 599 | greatest(1,'2',3.3,4.4,5) | |
| 600 | ============================ |
| 601 | 5 | |
| 602 | taos> select GREATEST(1,2,3,4,5,'5.1'); |
| 603 | greatest(1,2,3,4,5,'5.1') | |
| 604 | ============================ |
| 605 | 5 | |
| 606 | taos> select GREATEST(121,'18'); |
| 607 | greatest(121,'18') | |
| 608 | ======================== |
| 609 | 121 | |
| 610 | taos> select GREATEST('1','2','3','4','5'); |
| 611 | greatest('1','2','3','4','5') | |
| 612 | ================================ |
| 613 | 5 | |
| 614 | taos> select GREATEST(1,2,3,4,5,6,7,'a','b','一','二','三'); |
| 615 | greatest(1,2,3,4,5,6,7,'a','b','一','二','三') | |
| 616 | ==================================================== |
| 617 | 7 | |
| 618 | taos> select GREATEST(1,2,3,4,5,6,7,'a','b','c','1','2','1231213'); |
| 619 | greatest(1,2,3,4,5,6,7,'a','b','c','1','2','1231213') | |
| 620 | ======================================================== |
| 621 | 1231213 | |
| 622 | taos> select GREATEST(1,2,3,4,5,6,7,'a','b','c','1','2','1231213','1231213.123123'); |
| 623 | greatest(1,2,3,4,5,6,7,'a','b','c','1','2','1231213','1231213.12 | |
| 624 | =================================================================== |
| 625 | 1231213 | |
| 626 | taos> select GREATEST(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint), cast(3 as int), cast(4 as bigint), cast(5 as float), cast(6 as double), cast(8 as varchar(20)), cast(9 as nchar(20))); |
| 627 | greatest(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint | |
| 628 | =================================================================== |
| 629 | 9 | |
| 630 | taos> select GREATEST(cast(0 as bool), cast(1 as tinyint unsigned), cast(2 as smallint unsigned), cast(3 as int unsigned), cast(4 as bigint unsigned), cast(5 as float), cast(6 as double), cast(8 as varchar(20)), cast(9 as nchar(20))); |
| 631 | greatest(cast(0 as bool), cast(1 as tinyint unsigned), cast(2 as | |
| 632 | =================================================================== |
| 633 | 9 | |
| 634 | taos> select GREATEST(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint), cast(3 as int), cast(4 as bigint), cast(5 as float), cast(6 as double), cast(8 as varchar(20)), cast(9 as nchar(20)), cast(0 as bool), cast(1 as tinyint unsigned), cast(2 as smallint unsigned), cast(3 as int unsigned), cast(4 as bigint unsigned), cast(5 as float), cast(6 as double)); |
| 635 | greatest(cast(0 as bool), cast(1 as tinyint), cast(2 as smallint | |
| 636 | =================================================================== |
| 637 | 9 | |
| 638 | taos> select GREATEST(cast(100 as tinyint), cast(101 as tinyint)); |
| 639 | greatest(cast(100 as tinyint), cast(101 as tinyint)) | |
| 640 | ======================================================= |
| 641 | 101 | |
| 642 | taos> select GREATEST(cast(100 as tinyint), cast(101 as smallint)); |
| 643 | greatest(cast(100 as tinyint), cast(101 as smallint)) | |
| 644 | ======================================================== |
| 645 | 101 | |
| 646 | taos> select GREATEST(cast(100 as tinyint), cast(101 as int)); |
| 647 | greatest(cast(100 as tinyint), cast(101 as int)) | |
| 648 | =================================================== |
| 649 | 101 | |
| 650 | taos> select GREATEST(cast(100 as tinyint), cast(101 as bigint)); |
| 651 | greatest(cast(100 as tinyint), cast(101 as bigint)) | |
| 652 | ====================================================== |
| 653 | 101 | |
| 654 | taos> select GREATEST(cast(100 as tinyint), cast(101 as float)); |
| 655 | greatest(cast(100 as tinyint), cast(101 as float)) | |
| 656 | ===================================================== |
| 657 | 101 | |
| 658 | taos> select GREATEST(cast(100 as tinyint), cast(101 as double)); |
| 659 | greatest(cast(100 as tinyint), cast(101 as double)) | |
| 660 | ====================================================== |
| 661 | 101 | |
| 662 | taos> select GREATEST(cast(100 as tinyint), cast(101 as varchar(20))); |
| 663 | greatest(cast(100 as tinyint), cast(101 as varchar(20))) | |
| 664 | =========================================================== |
| 665 | 101 | |
| 666 | taos> select GREATEST(cast(100 as tinyint), cast(101 as nchar(20))); |
| 667 | greatest(cast(100 as tinyint), cast(101 as nchar(20))) | |
| 668 | ========================================================= |
| 669 | 101 | |
| 670 | taos> select GREATEST(cast(101 as tinyint), cast(100 as tinyint)); |
| 671 | greatest(cast(101 as tinyint), cast(100 as tinyint)) | |
| 672 | ======================================================= |
| 673 | 101 | |
| 674 | taos> select GREATEST(cast(101 as tinyint), cast(100 as smallint)); |
| 675 | greatest(cast(101 as tinyint), cast(100 as smallint)) | |
| 676 | ======================================================== |
| 677 | 101 | |
| 678 | taos> select GREATEST(cast(101 as tinyint), cast(100 as int)); |
| 679 | greatest(cast(101 as tinyint), cast(100 as int)) | |
| 680 | =================================================== |
| 681 | 101 | |
| 682 | taos> select GREATEST(cast(101 as tinyint), cast(100 as bigint)); |
| 683 | greatest(cast(101 as tinyint), cast(100 as bigint)) | |
| 684 | ====================================================== |
| 685 | 101 | |
| 686 | taos> select GREATEST(cast(101 as tinyint), cast(100 as float)); |
| 687 | greatest(cast(101 as tinyint), cast(100 as float)) | |
| 688 | ===================================================== |
| 689 | 101 | |
| 690 | taos> select GREATEST(cast(101 as tinyint), cast(100 as double)); |
| 691 | greatest(cast(101 as tinyint), cast(100 as double)) | |
| 692 | ====================================================== |
| 693 | 101 | |
| 694 | taos> select GREATEST(cast(101 as tinyint), cast(100 as varchar(20))); |
| 695 | greatest(cast(101 as tinyint), cast(100 as varchar(20))) | |
| 696 | =========================================================== |
| 697 | 101 | |
| 698 | taos> select GREATEST(cast(101 as tinyint), cast(100 as nchar(20))); |
| 699 | greatest(cast(101 as tinyint), cast(100 as nchar(20))) | |
| 700 | ========================================================= |
| 701 | 101 | |
| 702 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as smallint)); |
| 703 | greatest(cast(1000 as smallint), cast(1001 as smallint)) | |
| 704 | =========================================================== |
| 705 | 1001 | |
| 706 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as int)); |
| 707 | greatest(cast(1000 as smallint), cast(1001 as int)) | |
| 708 | ====================================================== |
| 709 | 1001 | |
| 710 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as bigint)); |
| 711 | greatest(cast(1000 as smallint), cast(1001 as bigint)) | |
| 712 | ========================================================= |
| 713 | 1001 | |
| 714 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as float)); |
| 715 | greatest(cast(1000 as smallint), cast(1001 as float)) | |
| 716 | ======================================================== |
| 717 | 1001 | |
| 718 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as double)); |
| 719 | greatest(cast(1000 as smallint), cast(1001 as double)) | |
| 720 | ========================================================= |
| 721 | 1001 | |
| 722 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as varchar(20))); |
| 723 | greatest(cast(1000 as smallint), cast(1001 as varchar(20))) | |
| 724 | ============================================================== |
| 725 | 1001 | |
| 726 | taos> select GREATEST(cast(1000 as smallint), cast(1001 as nchar(20))); |
| 727 | greatest(cast(1000 as smallint), cast(1001 as nchar(20))) | |
| 728 | ============================================================ |
| 729 | 1001 | |
| 730 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as smallint)); |
| 731 | greatest(cast(1001 as smallint), cast(1000 as smallint)) | |
| 732 | =========================================================== |
| 733 | 1001 | |
| 734 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as int)); |
| 735 | greatest(cast(1001 as smallint), cast(1000 as int)) | |
| 736 | ====================================================== |
| 737 | 1001 | |
| 738 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as bigint)); |
| 739 | greatest(cast(1001 as smallint), cast(1000 as bigint)) | |
| 740 | ========================================================= |
| 741 | 1001 | |
| 742 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as float)); |
| 743 | greatest(cast(1001 as smallint), cast(1000 as float)) | |
| 744 | ======================================================== |
| 745 | 1001 | |
| 746 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as double)); |
| 747 | greatest(cast(1001 as smallint), cast(1000 as double)) | |
| 748 | ========================================================= |
| 749 | 1001 | |
| 750 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as varchar(20))); |
| 751 | greatest(cast(1001 as smallint), cast(1000 as varchar(20))) | |
| 752 | ============================================================== |
| 753 | 1001 | |
| 754 | taos> select GREATEST(cast(1001 as smallint), cast(1000 as nchar(20))); |
| 755 | greatest(cast(1001 as smallint), cast(1000 as nchar(20))) | |
| 756 | ============================================================ |
| 757 | 1001 | |
| 758 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as int)); |
| 759 | greatest(cast(1000000 as int), cast(1000001 as int)) | |
| 760 | ======================================================= |
| 761 | 1000001 | |
| 762 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as bigint)); |
| 763 | greatest(cast(1000000 as int), cast(1000001 as bigint)) | |
| 764 | ========================================================== |
| 765 | 1000001 | |
| 766 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as float)); |
| 767 | greatest(cast(1000000 as int), cast(1000001 as float)) | |
| 768 | ========================================================= |
| 769 | 1e+06 | |
| 770 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as double)); |
| 771 | greatest(cast(1000000 as int), cast(1000001 as double)) | |
| 772 | ========================================================== |
| 773 | 1000001 | |
| 774 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as varchar(20))); |
| 775 | greatest(cast(1000000 as int), cast(1000001 as varchar(20))) | |
| 776 | =============================================================== |
| 777 | 1000001 | |
| 778 | taos> select GREATEST(cast(1000000 as int), cast(1000001 as nchar(20))); |
| 779 | greatest(cast(1000000 as int), cast(1000001 as nchar(20))) | |
| 780 | ============================================================= |
| 781 | 1000001 | |
| 782 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as int)); |
| 783 | greatest(cast(1000001 as int), cast(1000000 as int)) | |
| 784 | ======================================================= |
| 785 | 1000001 | |
| 786 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as bigint)); |
| 787 | greatest(cast(1000001 as int), cast(1000000 as bigint)) | |
| 788 | ========================================================== |
| 789 | 1000001 | |
| 790 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as float)); |
| 791 | greatest(cast(1000001 as int), cast(1000000 as float)) | |
| 792 | ========================================================= |
| 793 | 1e+06 | |
| 794 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as double)); |
| 795 | greatest(cast(1000001 as int), cast(1000000 as double)) | |
| 796 | ========================================================== |
| 797 | 1000001 | |
| 798 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as varchar(20))); |
| 799 | greatest(cast(1000001 as int), cast(1000000 as varchar(20))) | |
| 800 | =============================================================== |
| 801 | 1000001 | |
| 802 | taos> select GREATEST(cast(1000001 as int), cast(1000000 as nchar(20))); |
| 803 | greatest(cast(1000001 as int), cast(1000000 as nchar(20))) | |
| 804 | ============================================================= |
| 805 | 1000001 | |
| 806 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as bigint)); |
| 807 | greatest(cast(1000000000 as bigint), cast(1000000001 as bigint)) | |
| 808 | =================================================================== |
| 809 | 1000000001 | |
| 810 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as float)); |
| 811 | greatest(cast(1000000000 as bigint), cast(1000000001 as float)) | |
| 812 | ================================================================== |
| 813 | 1e+09 | |
| 814 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as double)); |
| 815 | greatest(cast(1000000000 as bigint), cast(1000000001 as double)) | |
| 816 | =================================================================== |
| 817 | 1000000001 | |
| 818 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as varchar(20))); |
| 819 | greatest(cast(1000000000 as bigint), cast(1000000001 as varchar( | |
| 820 | =================================================================== |
| 821 | 1000000001 | |
| 822 | taos> select GREATEST(cast(1000000000 as bigint), cast(1000000001 as nchar(20))); |
| 823 | greatest(cast(1000000000 as bigint), cast(1000000001 as nchar(20 | |
| 824 | =================================================================== |
| 825 | 1000000001 | |
| 826 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as bigint)); |
| 827 | greatest(cast(1000000001 as bigint), cast(1000000000 as bigint)) | |
| 828 | =================================================================== |
| 829 | 1000000001 | |
| 830 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as float)); |
| 831 | greatest(cast(1000000001 as bigint), cast(1000000000 as float)) | |
| 832 | ================================================================== |
| 833 | 1e+09 | |
| 834 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as double)); |
| 835 | greatest(cast(1000000001 as bigint), cast(1000000000 as double)) | |
| 836 | =================================================================== |
| 837 | 1000000001 | |
| 838 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as varchar(20))); |
| 839 | greatest(cast(1000000001 as bigint), cast(1000000000 as varchar( | |
| 840 | =================================================================== |
| 841 | 1000000001 | |
| 842 | taos> select GREATEST(cast(1000000001 as bigint), cast(1000000000 as nchar(20))); |
| 843 | greatest(cast(1000000001 as bigint), cast(1000000000 as nchar(20 | |
| 844 | =================================================================== |
| 845 | 1000000001 | |
| 846 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as float)); |
| 847 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as f | |
| 848 | =================================================================== |
| 849 | 100001 | |
| 850 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as double)); |
| 851 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as d | |
| 852 | =================================================================== |
| 853 | 100001.1111111 | |
| 854 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as timestamp)); |
| 855 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as t | |
| 856 | =================================================================== |
| 857 | 100001 | |
| 858 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as varchar(20))); |
| 859 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as v | |
| 860 | =================================================================== |
| 861 | 100001 | |
| 862 | taos> select GREATEST(cast(100000.1111111 as float), cast(100001.1111111 as nchar(20))); |
| 863 | greatest(cast(100000.1111111 as float), cast(100001.1111111 as n | |
| 864 | =================================================================== |
| 865 | 100001 | |
| 866 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as float)); |
| 867 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as f | |
| 868 | =================================================================== |
| 869 | 100001 | |
| 870 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as double)); |
| 871 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as d | |
| 872 | =================================================================== |
| 873 | 100001.109375 | |
| 874 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as timestamp)); |
| 875 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as t | |
| 876 | =================================================================== |
| 877 | 100001 | |
| 878 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as varchar(20))); |
| 879 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as v | |
| 880 | =================================================================== |
| 881 | 100001 | |
| 882 | taos> select GREATEST(cast(100001.1111111 as float), cast(100000.1111111 as nchar(20))); |
| 883 | greatest(cast(100001.1111111 as float), cast(100000.1111111 as n | |
| 884 | =================================================================== |
| 885 | 100001 | |
| 886 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as double)); |
| 887 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 888 | =================================================================== |
| 889 | 100001.1111111 | |
| 890 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as timestamp)); |
| 891 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 892 | =================================================================== |
| 893 | 100001 | |
| 894 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as varchar(20))); |
| 895 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 896 | =================================================================== |
| 897 | 100001.1111111 | |
| 898 | taos> select GREATEST(cast(100000.1111111 as double), cast(100001.1111111 as nchar(20))); |
| 899 | greatest(cast(100000.1111111 as double), cast(100001.1111111 as | |
| 900 | =================================================================== |
| 901 | 100001.1111111 | |
| 902 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as double)); |
| 903 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 904 | =================================================================== |
| 905 | 100001.1111111 | |
| 906 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as timestamp)); |
| 907 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 908 | =================================================================== |
| 909 | 100001.1111111 | |
| 910 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as varchar(20))); |
| 911 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 912 | =================================================================== |
| 913 | 100001.1111111 | |
| 914 | taos> select GREATEST(cast(100001.1111111 as double), cast(100000.1111111 as nchar(20))); |
| 915 | greatest(cast(100001.1111111 as double), cast(100000.1111111 as | |
| 916 | =================================================================== |
| 917 | 100001.1111111 | |
| 918 | taos> select GREATEST(cast('中文测试' as varchar(20)), cast('中文测试一' as varchar(20))); |
| 919 | greatest(cast('中文测试' as varchar(20)), cast('中文测试 | |
| 920 | =================================================================== |
| 921 | 中文测试一 | |
| 922 | taos> select GREATEST(cast('中文测试' as varchar(20)), cast('中文测试一' as nchar(20))); |
| 923 | greatest(cast('中文测试' as varchar(20)), cast('中文测试 | |
| 924 | =================================================================== |
| 925 | 中文测试一 | |
| 926 | taos> select GREATEST(cast('中文测试一' as varchar(20)), cast('中文测试' as varchar(20))); |
| 927 | greatest(cast('中文测试一' as varchar(20)), cast('中文测 | |
| 928 | =================================================================== |
| 929 | 中文测试一 | |
| 930 | taos> select GREATEST(cast('中文测试一' as varchar(20)), cast('中文测试' as nchar(20))); |
| 931 | greatest(cast('中文测试一' as varchar(20)), cast('中文测 | |
| 932 | =================================================================== |
| 933 | 中文测试一 | |
| 934 | taos> select GREATEST(cast('abc123abc' as varchar(20)), cast('abc124abc' as varchar(20))); |
| 935 | greatest(cast('abc123abc' as varchar(20)), cast('abc124abc' as v | |
| 936 | =================================================================== |
| 937 | abc124abc | |
| 938 | taos> select GREATEST(cast('abc123abc' as varchar(20)), cast('abc124abc' as nchar(20))); |
| 939 | greatest(cast('abc123abc' as varchar(20)), cast('abc124abc' as n | |
| 940 | =================================================================== |
| 941 | abc124abc | |
| 942 | taos> select GREATEST(cast('abc124abc' as varchar(20)), cast('abc123abc' as varchar(20))); |
| 943 | greatest(cast('abc124abc' as varchar(20)), cast('abc123abc' as v | |
| 944 | =================================================================== |
| 945 | abc124abc | |
| 946 | taos> select GREATEST(cast('abc124abc' as varchar(20)), cast('abc123abc' as nchar(20))); |
| 947 | greatest(cast('abc124abc' as varchar(20)), cast('abc123abc' as n | |
| 948 | =================================================================== |
| 949 | abc124abc | |
| 950 | taos> select GREATEST(cast('abc123abc' as nchar(20)), cast('abc124abc' as nchar(20))); |
| 951 | greatest(cast('abc123abc' as nchar(20)), cast('abc124abc' as nch | |
| 952 | =================================================================== |
| 953 | abc124abc | |
| 954 | taos> select GREATEST(cast(100 as tinyint), cast(101 as float), cast(102 as varchar(20))); |
| 955 | greatest(cast(100 as tinyint), cast(101 as float), cast(102 as v | |
| 956 | =================================================================== |
| 957 | 102 | |
| 958 | taos> select GREATEST(cast(100 as float), cast(101 as tinyint), cast(102 as varchar(20))); |
| 959 | greatest(cast(100 as float), cast(101 as tinyint), cast(102 as v | |
| 960 | =================================================================== |
| 961 | 102 | |
| 962 | taos> select GREATEST(cast(100 as float), cast(101 as varchar(20)), cast(102 as tinyint)); |
| 963 | greatest(cast(100 as float), cast(101 as varchar(20)), cast(102 | |
| 964 | =================================================================== |
| 965 | 102 | |
| 966 | taos> select GREATEST(cast(100 as varchar(20)), cast(101 as float), cast(102 as tinyint)); |
| 967 | greatest(cast(100 as varchar(20)), cast(101 as float), cast(102 | |
| 968 | =================================================================== |
| 969 | 102 | |
| 970 | taos> select GREATEST('a','b','c','d','e','f','g','h','1231','15155'); |
| 971 | greatest('a','b','c','d','e','f','g','h','1231','15155') | |
| 972 | =========================================================== |
| 973 | h | |
| 974 | taos> select GREATEST(current, voltage, phase, id, nch1, nch2, var1, var2) from ts_4893.meters order by ts limit 10; |
| 975 | greatest(current, voltage, phase, id, nch1, nch2, var1, var2) | |
| 976 | ================================================================ |
| 977 | 221 | |
| 978 | 220 | |
| 979 | 215 | |
| 980 | 216 | |
| 981 | 219 | |
| 982 | 221 | |
| 983 | 215 | |
| 984 | 217 | |
| 985 | 216 | |
| 986 | 223 | |
| 987 | taos> select GREATEST(current, voltage, phase, id) from ts_4893.meters order by ts limit 10; |
| 988 | greatest(current, voltage, phase, id) | |
| 989 | ======================================== |
| 990 | 221 | |
| 991 | 220 | |
| 992 | 215 | |
| 993 | 216 | |
| 994 | 219 | |
| 995 | 221 | |
| 996 | 215 | |
| 997 | 217 | |
| 998 | 216 | |
| 999 | 223 | |
| 1000 | taos> select GREATEST(nch1, nch2, var1, var2) from ts_4893.meters order by ts limit 10; |
| 1001 | greatest(nch1, nch2, var1, var2) | |
| 1002 | =================================== |
| 1003 | 四 | |
| 1004 | 三a | |
| 1005 | 四 | |
| 1006 | 一 | |
| 1007 | 一二三四五六七八九十 | |
| 1008 | 一二三 | |
| 1009 | prision | |
| 1010 | 一二三四五六七八九十 | |
| 1011 | prision | |
| 1012 | 一 | |
| 1013 | taos> select GREATEST(221, voltage) from ts_4893.meters order by ts limit 10; |
| 1014 | greatest(221, voltage) | |
| 1015 | ========================= |
| 1016 | 221 | |
| 1017 | 221 | |
| 1018 | 221 | |
| 1019 | 221 | |
| 1020 | 221 | |
| 1021 | 221 | |
| 1022 | 221 | |
| 1023 | 221 | |
| 1024 | 221 | |
| 1025 | 223 | |
| 1026 | taos> select GREATEST(5, id) from ts_4893.meters order by ts limit 10; |
| 1027 | greatest(5, id) | |
| 1028 | ======================== |
| 1029 | 5 | |
| 1030 | 5 | |
| 1031 | 5 | |
| 1032 | 5 | |
| 1033 | 5 | |
| 1034 | 5 | |
| 1035 | 6 | |
| 1036 | 7 | |
| 1037 | 8 | |
| 1038 | 9 | |
| 1039 | taos> select GREATEST('r', nch1) from ts_4893.meters order by ts limit 10; |
| 1040 | greatest('r', nch1) | |
| 1041 | ================================= |
| 1042 | r | |
| 1043 | 一二三四五六七八九十 | |
| 1044 | update | |
| 1045 | r | |
| 1046 | r | |
| 1047 | r | |
| 1048 | r | |
| 1049 | 一二三四五六七八九十 | |
| 1050 | r | |
| 1051 | r | |
| 1052 | taos> select GREATEST('r', nch1, nch2) from ts_4893.meters order by ts limit 10; |
| 1053 | greatest('r', nch1, nch2) | |
| 1054 | ================================= |
| 1055 | 四 | |
| 1056 | 一二三四五六七八九十 | |
| 1057 | update | |
| 1058 | 一 | |
| 1059 | r | |
| 1060 | 一二三 | |
| 1061 | r | |
| 1062 | 一二三四五六七八九十 | |
| 1063 | r | |
| 1064 | r | |
| 1065 | taos> select GREATEST('r', var1) from ts_4893.meters order by ts limit 10; |
| 1066 | greatest('r', var1) | |
| 1067 | ================================= |
| 1068 | r | |
| 1069 | r | |
| 1070 | r | |
| 1071 | r | |
| 1072 | 一二三四五六七八九十 | |
| 1073 | update | |
| 1074 | r | |
| 1075 | r | |
| 1076 | r | |
| 1077 | r | |
| 1078 | taos> select GREATEST('r', var1, var2) from ts_4893.meters order by ts limit 10; |
| 1079 | greatest('r', var1, var2) | |
| 1080 | ================================= |
| 1081 | r | |
| 1082 | 三a | |
| 1083 | 四 | |
| 1084 | r | |
| 1085 | 一二三四五六七八九十 | |
| 1086 | update | |
| 1087 | r | |
| 1088 | r | |
| 1089 | r | |
| 1090 | 一 | |
| 1091 | taos> select GREATEST('二中文测试', nch1) from ts_4893.meters order by ts limit 10; |
| 1092 | greatest('二中文测试', nch1) | |
| 1093 | ==================================== |
| 1094 | 二中文测试 | |
| 1095 | 二中文测试 | |
| 1096 | 二中文测试 | |
| 1097 | 二中文测试 | |
| 1098 | 二中文测试 | |
| 1099 | 二中文测试 | |
| 1100 | 二中文测试 | |
| 1101 | 二中文测试 | |
| 1102 | 二中文测试 | |
| 1103 | 二中文测试 | |
| 1104 | taos> select GREATEST('二中文测试', nch1, nch2) from ts_4893.meters order by ts limit 10; |
| 1105 | greatest('二中文测试', nch1, nch2) | |
| 1106 | ========================================== |
| 1107 | 四 | |
| 1108 | 二中文测试 | |
| 1109 | 二中文测试 | |
| 1110 | 二中文测试 | |
| 1111 | 二中文测试 | |
| 1112 | 二中文测试 | |
| 1113 | 二中文测试 | |
| 1114 | 二中文测试 | |
| 1115 | 二中文测试 | |
| 1116 | 二中文测试 | |
| 1117 | taos> select GREATEST('二中文测试', var1) from ts_4893.meters order by ts limit 10; |
| 1118 | greatest('二中文测试', var1) | |
| 1119 | ==================================== |
| 1120 | 二中文测试 | |
| 1121 | 二中文测试 | |
| 1122 | 二中文测试 | |
| 1123 | 二中文测试 | |
| 1124 | 二中文测试 | |
| 1125 | 二中文测试 | |
| 1126 | 二中文测试 | |
| 1127 | 二中文测试 | |
| 1128 | 二中文测试 | |
| 1129 | 二中文测试 | |
| 1130 | taos> select GREATEST('二中文测试', var1, var2) from ts_4893.meters order by ts limit 10; |
| 1131 | greatest('二中文测试', var1, var2) | |
| 1132 | ========================================== |
| 1133 | 二中文测试 | |
| 1134 | 二中文测试 | |
| 1135 | 四 | |
| 1136 | 二中文测试 | |
| 1137 | 二中文测试 | |
| 1138 | 二中文测试 | |
| 1139 | 二中文测试 | |
| 1140 | 二中文测试 | |
| 1141 | 二中文测试 | |
| 1142 | 二中文测试 | |
| 1143 | taos> select GREATEST('23', 3443434343434343); |
| 1144 | greatest('23', 3443434343434343) | |
| 1145 | =================================== |
| 1146 | 3443434343434343 | |
| 1147 | taos> select GREATEST(co, 3443434343434343) from ts_4893.n1; |
| 1148 | greatest(co, 3443434343434343) | |
| 1149 | ================================= |
| 1150 | 3443434343434343 | |
| 1151 | 3443434343434343 | |
| 1152 | 3443434343434343 | |
| 1153 | taos> select GREATEST('23', 1443434343434343) from ts_4893.n1; |
| 1154 | greatest('23', 1443434343434343) | |
| 1155 | =================================== |
| 1156 | 1443434343434343 | |
| 1157 | 1443434343434343 | |
| 1158 | 1443434343434343 | |
| 1159 | taos> select GREATEST('23', 3443434343434343) from ts_4893.n1 |
| 1160 | greatest('23', 3443434343434343) | |
| 1161 | =================================== |
| 1162 | 3443434343434343 | |
| 1163 | 3443434343434343 | |
| 1164 | 3443434343434343 | |
| 1165 | taos> select GREATEST(current, voltage) from ts_4893.n1; |
| 1166 | greatest(current, voltage) | |
| 1167 | ============================= |
| 1168 | NULL | |
| 1169 | NULL | |
| 1170 | 5 | |
| 1171 | taos> select GREATEST(current, voltage, '15') from ts_4893.n1; |
| 1172 | greatest(current, voltage, '15') | |
| 1173 | =================================== |
| 1174 | NULL | |
| 1175 | NULL | |
| 1176 | 15 | |