taos> select POSITION('北' IN '北京涛思') position('北' in '北京涛思') | ==================================== 1 | taos> select POSITION('涛思' IN '北京涛思') position('涛思' in '北京涛思') | ======================================= 3 | taos> select POSITION('a' IN 'abcd') position('a' in 'abcd') | ========================== 1 | taos> select POSITION('e' IN 'abcd') position('e' in 'abcd') | ========================== 0 | taos> select POSITION('好,' IN 'hello,world.你好,世界。') position('好,' in 'hello,world.你好,世界。') | ========================================================= 14 | taos> select POSITION(',你' IN 'hello,world.你好,世界。') position(',你' in 'hello,world.你好,世界。') | ========================================================= 0 | taos> select POSITION('world' IN 'hello,world.你好,世界。') position('world' in 'hello,world.你好,世界。') | ======================================================== 7 | taos> select POSITION('aaa' IN 'aaaaaaaaa') position('aaa' in 'aaaaaaaaa') | ================================= 1 | taos> select POSITION(CONCAT('a','b','c') IN CONCAT('abc','def','ghi')) position(concat('a','b','c') in concat('abc','def','ghi')) | ============================================================= 1 | taos> select POSITION(CONCAT('a','b','d') IN CONCAT('abc','def','ghi')) position(concat('a','b','d') in concat('abc','def','ghi')) | ============================================================= 0 | taos> select POSITION(nch2 IN nch1) from ts_4893.meters where POSITION(nch2 IN nch1) != 0 order by ts limit 5 position(nch2 in nch1) | ========================= 4 | 2 | 5 | 4 | 2 | taos> select POSITION(nch2 IN nch1) from ts_4893.meters order by ts limit 5 position(nch2 in nch1) | ========================= 0 | 0 | 0 | 0 | 4 | taos> select POSITION(var2 IN var1) from ts_4893.meters where POSITION(var2 IN var1) != 0 order by ts limit 5 position(var2 in var1) | ========================= 4 | 5 | 4 | 1 | 3 | taos> select POSITION(var2 IN var1) from ts_4893.meters order by ts limit 5 position(var2 in var1) | ========================= 4 | 0 | 0 | 5 | 0 | taos> select POSITION(var2 IN nch1) from ts_4893.meters where POSITION(var2 IN nch1) != 0 order by ts limit 5 position(var2 in nch1) | ========================= 4 | 4 | 1 | 1 | 3 | taos> select POSITION(var2 IN nch1) from ts_4893.meters order by ts limit 5 position(var2 in nch1) | ========================= 4 | 0 | 0 | 0 | 0 | taos> select POSITION(nch2 IN var1) from ts_4893.meters where POSITION(nch2 IN var1) != 0 order by ts limit 5 position(nch2 in var1) | ========================= 3 | 2 | 1 | 4 | 3 | taos> select POSITION(nch2 IN var1) from ts_4893.meters order by ts limit 5 position(nch2 in var1) | ========================= 0 | 0 | 0 | 0 | 0 | taos> select POSITION('a' IN nch1) from ts_4893.meters where POSITION('a' IN nch1) != 0 order by ts limit 5 position('a' in nch1) | ======================== 4 | 1 | 1 | 3 | 1 | taos> select POSITION('a' IN var1) from ts_4893.meters where POSITION('a' IN var1) != 0 order by ts limit 5 position('a' in var1) | ======================== 3 | 4 | 3 | 4 | 4 | taos> select POSITION('一' IN nch1) from ts_4893.meters where POSITION('一' IN nch1) != 0 order by ts limit 5 position('一' in nch1) | ========================== 1 | 1 | 4 | 1 | 1 | taos> select POSITION('一' IN var1) from ts_4893.meters where POSITION('一' IN var1) != 0 order by ts limit 5 position('一' in var1) | ========================== 1 | 1 | 4 | 1 | 1 | taos> select POSITION(nch2 IN 'abcdefghijklmn') from ts_4893.meters where POSITION(nch2 IN 'abcdefghijklmn') != 0 order by ts limit 5 position(nch2 in 'abcdefghijklmn') | ===================================== 6 | 3 | 5 | 5 | 4 | taos> select POSITION(var2 IN 'abcdefghijklmn') from ts_4893.meters where POSITION(var2 IN 'abcdefghijklmn') != 0 order by ts limit 5 position(var2 in 'abcdefghijklmn') | ===================================== 5 | 5 | 2 | 7 | 2 | taos> select POSITION(nch2 IN '一二三四五六七八九十') from ts_4893.meters where POSITION(nch2 IN '一二三四五六七八九十') != 0 order by ts limit 5 position(nch2 in '一二三四五六七八九十') | ===================================================== 4 | 1 | 1 | 4 | 1 | taos> select POSITION(var2 IN '一二三四五六七八九十') from ts_4893.meters where POSITION(var2 IN '一二三四五六七八九十') != 0 order by ts limit 5 position(var2 in '一二三四五六七八九十') | ===================================================== 4 | 1 | 4 | 4 | 1 | taos> select ABS(POSITION('aaa' IN 'aaaaaaaaa')) abs(position('aaa' in 'aaaaaaaaa')) | ====================================== 1 | taos> select POW(POSITION('aaa' IN 'aaaaaaaaa'), 2) pow(position('aaa' in 'aaaaaaaaa'), 2) | ========================================= 1 | taos> select position('t' in 'taos') position('t' in 'taos') | ========================== 1 | taos> select position('ustc' in 'taos') position('ustc' in 'taos') | ============================= 0 | taos> select position('' in '') position('' in '') | ======================== 1 | taos> select position('' in 'taos') position('' in 'taos') | ========================= 1 | taos> select position(nch2 in nch1) from ts_4893.d0 order by ts limit 10 position(nch2 in nch1) | ========================= 0 | 0 | 0 | 0 | 4 | 0 | 0 | 0 | 0 | 0 | taos> select position(nch2 in nch1) from ts_4893.meters order by ts limit 10 position(nch2 in nch1) | ========================= 0 | 0 | 0 | 0 | 4 | 0 | 0 | 0 | 0 | 0 | taos> select position(nch2 in var1) from ts_4893.d0 order by ts limit 10 position(nch2 in var1) | ========================= 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | taos> select position(nch2 in var1) from ts_4893.meters order by ts limit 10 position(nch2 in var1) | ========================= 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | taos> select position(var2 in nch1) from ts_4893.d0 order by ts limit 10 position(var2 in nch1) | ========================= 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | taos> select position(var2 in nch1) from ts_4893.meters order by ts limit 10 position(var2 in nch1) | ========================= 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | taos> select position(var2 in var1) from ts_4893.d0 order by ts limit 10 position(var2 in var1) | ========================= 4 | 0 | 0 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | taos> select position(var2 in var1) from ts_4893.meters order by ts limit 10 position(var2 in var1) | ========================= 4 | 0 | 0 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | taos> select position('t' in null) position('t' in null) | ======================== NULL | taos> select position(null in 'taos') position(null in 'taos') | =========================== NULL | taos> select position('' in 'A') position('' in 'A') | ======================== 1 | taos> select position('A' in 'A') position('A' in 'A') | ======================== 1 | taos> select position('A' in '') position('A' in '') | ======================== 0 | taos> select position('A' in null) position('A' in null) | ======================== NULL | taos> select position('Z' in 'ABC') position('Z' in 'ABC') | ========================= 0 | taos> select position('l' in 'Hello') position('l' in 'Hello') | =========================== 3 | taos> select position('s' in 'meters') position('s' in 'meters') | ============================ 6 | taos> select position('中' in '中国') position('中' in '中国') | ============================== 1 | taos> select position('e' in 'é') position('e' in 'é') | ======================== 0 | taos> select position('W' in 'Hello World') position('W' in 'Hello World') | ================================= 7 | taos> select position('@' in '!@#') position('@' in '!@#') | ========================= 2 | taos> select position('6' in '12345') position('6' in '12345') | =========================== 0 | taos> select position('A' in trim(' A ')) position('A' in trim(' A ')) | =============================== 1 | taos> select position('A' in upper('abc')) position('A' in upper('abc')) | ================================ 1 | taos> select position('B' in concat('A', 'B')) position('B' in concat('A', 'B')) | ==================================== 2 | taos> select position('x' in replace('Hello', 'l', 'x')) position('x' in replace('Hello', 'l', 'x')) | ============================================== 3 | taos> select name, position('e' in name) from ts_4893.meters limit 1 name | position('e' in name) | ========================================================= lili | 0 | taos> select name, position('a' in substring(name, 2, 5)) from ts_4893.meters limit 1 name | position('a' in substring(name, 2, 5)) | ========================================================================== lili | 0 | taos> select nch1, position('n' in nch1) from ts_4893.meters limit 1 nch1 | position('n' in nch1) | ========================================================= novel | 1 | taos> select var1, position('1' in var1) from ts_4893.meters limit 1 var1 | position('1' in var1) | ========================================================= novel | 0 |