github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_multi_field.result (about) 1 SELECT FIELD('Bb', 'Aa', 'Bb', 'Cc', 'Dd', 'Ff'); 2 field(Bb, Aa, Bb, Cc, Dd, Ff) 3 2 4 SELECT FIELD('Bb', 'Bb', 'Aa', 'Cc', 'Dd', 'Ff'); 5 field(Bb, Bb, Aa, Cc, Dd, Ff) 6 1 7 SELECT FIELD('Bb', 'Aa', 'Cc', 'Bb', 'Dd', 'Ff'); 8 field(Bb, Aa, Cc, Bb, Dd, Ff) 9 3 10 SELECT FIELD('Bb', 'Aa', 'Cc', 'Dd', 'Bb', 'Ff'); 11 field(Bb, Aa, Cc, Dd, Bb, Ff) 12 4 13 SELECT FIELD('Bb', 'Aa', 'Cc', 'Dd', 'Ff', 'Bb'); 14 field(Bb, Aa, Cc, Dd, Ff, Bb) 15 5 16 SELECT FIELD('Gg', 'Aa', 'Bb', 'Cc', 'Dd', 'Ff'); 17 field(Gg, Aa, Bb, Cc, Dd, Ff) 18 0 19 SELECT FIELD(null, 'Aa', 'Bb', 'Cc', 'Dd', 'Ff'); 20 field(null, Aa, Bb, Cc, Dd, Ff) 21 0 22 SELECT FIELD('Bb', null, 'Bb', 'Cc', 'Dd', 'Ff'); 23 field(Bb, null, Bb, Cc, Dd, Ff) 24 2 25 SELECT FIELD('Bb', 'Aa', null, 'Cc', 'Dd', 'Ff'); 26 field(Bb, Aa, null, Cc, Dd, Ff) 27 0 28 SELECT FIELD('Bb', null, null, null, 'Bb', null, 'Dd', 'Ff'); 29 field(Bb, null, null, null, Bb, null, Dd, Ff) 30 4 31 create table test(a varchar(20)); 32 insert into test values('Aa'); 33 insert into test values('Bb'); 34 insert into test values('Cc'); 35 insert into test values('Dd'); 36 insert into test values('Ee'); 37 insert into test values('Ff'); 38 SELECT FIELD(null, a, 'Aa', 'Bb', 'Cc', 'Dd', 'Ff') from test; 39 field(null, a, Aa, Bb, Cc, Dd, Ff) 40 0 41 0 42 0 43 0 44 0 45 0 46 SELECT FIELD(a, 'Aa', 'Bb', 'Cc', 'Dd', 'Ff') from test; 47 field(a, Aa, Bb, Cc, Dd, Ff) 48 1 49 2 50 3 51 4 52 0 53 5 54 SELECT FIELD('Aa', a, 'Bb', 'Cc', 'Dd', 'Ff') from test; 55 field(Aa, a, Bb, Cc, Dd, Ff) 56 1 57 0 58 0 59 0 60 0 61 0 62 SELECT FIELD('Aa', 'Bb', a, 'Cc', 'Dd', 'Ff') from test; 63 field(Aa, Bb, a, Cc, Dd, Ff) 64 2 65 0 66 0 67 0 68 0 69 0 70 SELECT FIELD('Aa', 'Bb', 'Cc', a, 'Dd', 'Ff') from test; 71 field(Aa, Bb, Cc, a, Dd, Ff) 72 3 73 0 74 0 75 0 76 0 77 0 78 SELECT FIELD('Aa', 'Aa', 'Cc', a, 'Dd', 'Ff') from test; 79 field(Aa, Aa, Cc, a, Dd, Ff) 80 1 81 1 82 1 83 1 84 1 85 1 86 SELECT FIELD(a, null, null, null, null) from test; 87 field(a, null, null, null, null) 88 0 89 0 90 0 91 0 92 0 93 0 94 drop table test; 95 SELECT FIELD(1, 1, 2, 3, 4, 5); 96 field(1, 1, 2, 3, 4, 5) 97 1 98 SELECT FIELD(2, 1, 2, 3, 4, 5); 99 field(2, 1, 2, 3, 4, 5) 100 2 101 SELECT FIELD(3, 1, 2, 3, 4, 5); 102 field(3, 1, 2, 3, 4, 5) 103 3 104 SELECT FIELD(4, 1, 2, 3, 4, 5); 105 field(4, 1, 2, 3, 4, 5) 106 4 107 SELECT FIELD(5, 1, 2, 3, 4, 5); 108 field(5, 1, 2, 3, 4, 5) 109 5 110 SELECT FIELD(6, 1, 2, 3, 4, 5); 111 field(6, 1, 2, 3, 4, 5) 112 0 113 SELECT FIELD(null, 1, 1, 2, 3, 4, 5); 114 field(null, 1, 1, 2, 3, 4, 5) 115 0 116 SELECT FIELD(1, null, 2, 3, 4, 5); 117 field(1, null, 2, 3, 4, 5) 118 0 119 SELECT FIELD(1, 1, null, 3, 4, 5); 120 field(1, 1, null, 3, 4, 5) 121 1 122 SELECT FIELD(1, null, null, null, 1, null); 123 field(1, null, null, null, 1, null) 124 4 125 create table test(a int); 126 insert into test values(1); 127 insert into test values(2); 128 insert into test values(3); 129 insert into test values(4); 130 insert into test values(5); 131 insert into test values(6); 132 SELECT FIELD(null, a, 1, 2, 3, 4, 5) from test; 133 field(null, a, 1, 2, 3, 4, 5) 134 0 135 0 136 0 137 0 138 0 139 0 140 SELECT FIELD(a, 1, 2, 3, 4, 5) from test; 141 field(a, 1, 2, 3, 4, 5) 142 1 143 2 144 3 145 4 146 5 147 0 148 SELECT FIELD(1, a, 2, 3, 4, 5) from test; 149 field(1, a, 2, 3, 4, 5) 150 1 151 0 152 0 153 0 154 0 155 0 156 SELECT FIELD(1, 2, a, 3, 4, 5) from test; 157 field(1, 2, a, 3, 4, 5) 158 2 159 0 160 0 161 0 162 0 163 0 164 SELECT FIELD(1, 2, 3, a, 4, 5) from test; 165 field(1, 2, 3, a, 4, 5) 166 3 167 0 168 0 169 0 170 0 171 0 172 SELECT FIELD(1, 2, 3, 4, a, 5) from test; 173 field(1, 2, 3, 4, a, 5) 174 4 175 0 176 0 177 0 178 0 179 0 180 SELECT FIELD(a, null, null, null) from test; 181 field(a, null, null, null) 182 0 183 0 184 0 185 0 186 0 187 0 188 drop table test; 189 SELECT FIELD(1, '1', '2', 3, 4, 5); 190 field(1, 1, 2, 3, 4, 5) 191 1 192 SELECT FIELD(2, 1, '2', 3, 4, 5); 193 field(2, 1, 2, 3, 4, 5) 194 2 195 SELECT FIELD(3, 1, '2', 3, 4, 5); 196 field(3, 1, 2, 3, 4, 5) 197 3 198 SELECT FIELD(4, '1', '2', 3, 4, 5); 199 field(4, 1, 2, 3, 4, 5) 200 4 201 SELECT FIELD('5', 1, 2, 3, 4, 5); 202 field(5, 1, 2, 3, 4, 5) 203 5 204 SELECT FIELD('6', 1, 2, 3, 4, 5); 205 field(6, 1, 2, 3, 4, 5) 206 0 207 SELECT FIELD(null, 1, '1', 2, '3', 4, 5); 208 field(null, 1, 1, 2, 3, 4, 5) 209 0 210 SELECT FIELD(1, null, 2, '3', 4, 5); 211 field(1, null, 2, 3, 4, 5) 212 0 213 SELECT FIELD(1, 1, null, 3, '4', 5); 214 field(1, 1, null, 3, 4, 5) 215 1 216 SELECT FIELD(1, null, null, null, '1', null); 217 field(1, null, null, null, 1, null) 218 4 219 create table test(a int); 220 insert into test values(1); 221 insert into test values(2); 222 insert into test values(3); 223 insert into test values(4); 224 insert into test values(5); 225 insert into test values(6); 226 SELECT FIELD(null, a, '1', 2, 3, 4, 5) from test; 227 field(null, a, 1, 2, 3, 4, 5) 228 0 229 0 230 0 231 0 232 0 233 0 234 SELECT FIELD(a, '1', 2, 3, 4, 5) from test; 235 field(a, 1, 2, 3, 4, 5) 236 1 237 2 238 3 239 4 240 5 241 0 242 SELECT FIELD('1', a, 2, 3, 4, 5) from test; 243 field(1, a, 2, 3, 4, 5) 244 1 245 0 246 0 247 0 248 0 249 0 250 SELECT FIELD(1, '2', a, 3, 4, 5) from test; 251 field(1, 2, a, 3, 4, 5) 252 2 253 0 254 0 255 0 256 0 257 0 258 SELECT FIELD(1, 2, '3', a, 4, 5) from test; 259 field(1, 2, 3, a, 4, 5) 260 3 261 0 262 0 263 0 264 0 265 0 266 SELECT FIELD('1', 2, 3, 4, a, 5) from test; 267 field(1, 2, 3, 4, a, 5) 268 4 269 0 270 0 271 0 272 0 273 0 274 SELECT FIELD(a, null, null, null) from test; 275 field(a, null, null, null) 276 0 277 0 278 0 279 0 280 0 281 0 282 drop table test; 283 SELECT FIELD(1.39479374937490, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494); 284 field(1.39479374937490, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494) 285 1 286 SELECT FIELD(1.39479374937491, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494); 287 field(1.39479374937491, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494) 288 2 289 SELECT FIELD(1.39479374937492, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494); 290 field(1.39479374937492, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494) 291 3 292 SELECT FIELD(1.39479374937493, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494); 293 field(1.39479374937493, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494) 294 4 295 SELECT FIELD(1.39479374937494, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494); 296 field(1.39479374937494, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494) 297 5 298 SELECT FIELD(1.39479374937495, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494); 299 field(1.39479374937495, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494) 300 0 301 SELECT FIELD(1.39479374937496, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494); 302 field(1.39479374937496, 1.39479374937490, 1.39479374937491, 1.39479374937492, 1.39479374937493, 1.39479374937494) 303 0