8.4 KiB
8.4 KiB
| 1 | taos> select CHAR_LENGTH('hello') |
|---|---|
| 2 | char_length('hello') | |
| 3 | ======================== |
| 4 | 5 | |
| 5 | taos> select CHAR_LENGTH('hello world') |
| 6 | char_length('hello world') | |
| 7 | ============================= |
| 8 | 11 | |
| 9 | taos> select CHAR_LENGTH('hello world!') |
| 10 | char_length('hello world!') | |
| 11 | ============================== |
| 12 | 12 | |
| 13 | ================================================ |
| 14 | 18 | |
| 15 | taos> select CHAR_LENGTH('北京涛思数据科技有限公司') |
| 16 | char_length('北京涛思数据科技有限公司') | |
| 17 | ====================================================== |
| 18 | 12 | |
| 19 | taos> select CHAR_LENGTH('hello') + 1 |
| 20 | char_length('hello') + 1 | |
| 21 | ============================ |
| 22 | 6.000000000000000 | |
| 23 | taos> select CHAR_LENGTH('hello') - 1 |
| 24 | char_length('hello') - 1 | |
| 25 | ============================ |
| 26 | 4.000000000000000 | |
| 27 | taos> select CHAR_LENGTH('hello') from ts_4893.meters limit 5 |
| 28 | char_length('hello') | |
| 29 | ======================== |
| 30 | 5 | |
| 31 | 5 | |
| 32 | 5 | |
| 33 | 5 | |
| 34 | 5 | |
| 35 | taos> select CHAR_LENGTH('hello') + 1 from ts_4893.meters limit 1 |
| 36 | char_length('hello') + 1 | |
| 37 | ============================ |
| 38 | 6.000000000000000 | |
| 39 | taos> select CHAR_LENGTH('hello') + CHAR_LENGTH('hello') from ts_4893.meters limit 1 |
| 40 | char_length('hello') + char_length('hello') | |
| 41 | ============================================== |
| 42 | 1.000000000000000e+01 | |
| 43 | taos> select CHAR_LENGTH(nch1) from ts_4893.meters order by ts limit 5 |
| 44 | char_length(nch1) | |
| 45 | ======================== |
| 46 | 5 | |
| 47 | 10 | |
| 48 | 6 | |
| 49 | 7 | |
| 50 | 5 | |
| 51 | taos> select CHAR_LENGTH(var1) from ts_4893.meters order by ts limit 5 |
| 52 | char_length(var1) | |
| 53 | ======================== |
| 54 | 5 | |
| 55 | 6 | |
| 56 | 5 | |
| 57 | 5 | |
| 58 | 10 | |
| 59 | ================================= |
| 60 | 10 | |
| 61 | 16 | |
| 62 | 11 | |
| 63 | 12 | |
| 64 | 15 | |
| 65 | taos> select CHAR_LENGTH(cast(nch1 as varchar)) from ts_4893.meters order by ts limit 5 |
| 66 | char_length(cast(nch1 as varchar)) | |
| 67 | ===================================== |
| 68 | 5 | |
| 69 | 10 | |
| 70 | 6 | |
| 71 | 7 | |
| 72 | 5 | |
| 73 | ============================ |
| 74 | 25.000000000000000 | |
| 75 | 100.000000000000000 | |
| 76 | 36.000000000000000 | |
| 77 | 49.000000000000000 | |
| 78 | 25.000000000000000 | |
| 79 | taos> select sqrt(CHAR_LENGTH(nch1)) from ts_4893.meters order by ts limit 5 |
| 80 | sqrt(char_length(nch1)) | |
| 81 | ============================ |
| 82 | 2.236067977499790 | |
| 83 | 3.162277660168380 | |
| 84 | 2.449489742783178 | |
| 85 | 2.645751311064591 | |
| 86 | 2.236067977499790 | |
| 87 | taos> select cast(CHAR_LENGTH(nch1) as int) from ts_4893.meters order by ts limit 5 |
| 88 | cast(char_length(nch1) as int) | |
| 89 | ================================= |
| 90 | 5 | |
| 91 | 10 | |
| 92 | 6 | |
| 93 | 7 | |
| 94 | 5 | |
| 95 | taos> select char_length('taos') |
| 96 | char_length('taos') | |
| 97 | ======================== |
| 98 | 4 | |
| 99 | taos> select char_length('涛思') |
| 100 | char_length('涛思') | |
| 101 | ======================== |
| 102 | 2 | |
| 103 | taos> select char_length('涛思taos') |
| 104 | char_length('涛思taos') | |
| 105 | ============================ |
| 106 | 6 | |
| 107 | taos> select char_length('tao\'s') |
| 108 | char_length('tao\'s') | |
| 109 | ======================== |
| 110 | 5 | |
| 111 | taos> select char_length(nch1) from ts_4893.d0 limit 10 |
| 112 | char_length(nch1) | |
| 113 | ======================== |
| 114 | 5 | |
| 115 | 10 | |
| 116 | 6 | |
| 117 | 7 | |
| 118 | 5 | |
| 119 | 5 | |
| 120 | 5 | |
| 121 | 10 | |
| 122 | 5 | |
| 123 | 5 | |
| 124 | taos> select char_length(nch1) from ts_4893.meters limit 10 |
| 125 | char_length(nch1) | |
| 126 | ======================== |
| 127 | 5 | |
| 128 | 10 | |
| 129 | 6 | |
| 130 | 7 | |
| 131 | 5 | |
| 132 | 5 | |
| 133 | 5 | |
| 134 | 10 | |
| 135 | 5 | |
| 136 | 5 | |
| 137 | taos> select char_length(var1) from ts_4893.d0 limit 10 |
| 138 | char_length(var1) | |
| 139 | ======================== |
| 140 | 5 | |
| 141 | 6 | |
| 142 | 5 | |
| 143 | 5 | |
| 144 | 10 | |
| 145 | 6 | |
| 146 | 7 | |
| 147 | 6 | |
| 148 | 7 | |
| 149 | 5 | |
| 150 | taos> select char_length(var1) from ts_4893.meters limit 10 |
| 151 | char_length(var1) | |
| 152 | ======================== |
| 153 | 5 | |
| 154 | 6 | |
| 155 | 5 | |
| 156 | 5 | |
| 157 | 10 | |
| 158 | 6 | |
| 159 | 7 | |
| 160 | 6 | |
| 161 | 7 | |
| 162 | 5 | |
| 163 | taos> select char_length(null) |
| 164 | char_length(null) | |
| 165 | ======================== |
| 166 | NULL | |
| 167 | taos> select char_length('') |
| 168 | char_length('') | |
| 169 | ======================== |
| 170 | 0 | |
| 171 | taos> select char_length('あいうえお') |
| 172 | char_length('あいうえお') | |
| 173 | ================================= |
| 174 | 5 | |
| 175 | taos> select min(char_length(name)) from ts_4893.meters |
| 176 | min(char_length(name)) | |
| 177 | ========================= |
| 178 | 1 | |
| 179 | taos> select max(char_length(name)) from ts_4893.meters |
| 180 | max(char_length(name)) | |
| 181 | ========================= |
| 182 | 4 | |
| 183 | trim(name) | char_length(trim(name)) | |
| 184 | =========================================================== |
| 185 | lili | 4 | |
| 186 | upper(name) | char_length(upper(name)) | |
| 187 | ============================================================ |
| 188 | LILI | 4 | |
| 189 | ============================================================================== |
| 190 | lili - beijing | 14 | |
| 191 | ====================================================================== |
| 192 | lili | 4 | |
| 193 | name | char_length(name) | |
| 194 | ========================================================= |
| 195 | lili | 4 | |
| 196 | nch1 | char_length(nch1) | |
| 197 | ========================================================= |
| 198 | novel | 5 | |
| 199 | groupid | max(char_length(name)) | |
| 200 | =================================== |
| 201 | 1 | 4 | |
| 202 | location | avg(char_length(name)) | |
| 203 | ================================================= |
| 204 | beijing | 3.244600000000000 | |