github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/function/func_string_substringindex.result (about)

     1  SELECT SUBSTRING_INDEX('www.mysql.com', '.', 0);
     2  substring_index(www.mysql.com, ., 0)
     3  
     4  SELECT SUBSTRING_INDEX('www.mysql.com', '.', 1);
     5  substring_index(www.mysql.com, ., 1)
     6  www
     7  SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
     8  substring_index(www.mysql.com, ., 2)
     9  www.mysql
    10  SELECT SUBSTRING_INDEX('www.mysql.com', '.', 3);
    11  substring_index(www.mysql.com, ., 3)
    12  www.mysql.com
    13  SELECT SUBSTRING_INDEX('www.mysql.com', '.', -3);
    14  substring_index(www.mysql.com, ., -3)
    15  www.mysql.com
    16  SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
    17  substring_index(www.mysql.com, ., -2)
    18  mysql.com
    19  SELECT SUBSTRING_INDEX('www.mysql.com', '.', -1);
    20  substring_index(www.mysql.com, ., -1)
    21  com
    22  SELECT SUBSTRING_INDEX('www.mysql.com', '', 0);
    23  substring_index(www.mysql.com, , 0)
    24  
    25  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '0');
    26  substring_index(www.mysql.com, ., 0)
    27  
    28  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '1');
    29  substring_index(www.mysql.com, ., 1)
    30  www
    31  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '2');
    32  substring_index(www.mysql.com, ., 2)
    33  www.mysql
    34  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '3');
    35  substring_index(www.mysql.com, ., 3)
    36  www.mysql.com
    37  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '4');
    38  substring_index(www.mysql.com, ., 4)
    39  www.mysql.com
    40  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '-3');
    41  substring_index(www.mysql.com, ., -3)
    42  www.mysql.com
    43  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '-2');
    44  substring_index(www.mysql.com, ., -2)
    45  mysql.com
    46  SELECT SUBSTRING_INDEX('www.mysql.com', '.', '-1');
    47  substring_index(www.mysql.com, ., -1)
    48  com
    49  SELECT SUBSTRING_INDEX('www.mysql.com', '', '0');
    50  substring_index(www.mysql.com, , 0)
    51  
    52  select substring_index('xyz', 'abc', 9223372036854775808);
    53  substring_index(xyz, abc, 9223372036854775808)
    54  xyz
    55  select substring_index("aaa.bbb.ccc.ddd.eee",'.',18446744073709551613);
    56  substring_index(aaa.bbb.ccc.ddd.eee, ., 18446744073709551613)
    57  aaa.bbb.ccc.ddd.eee
    58  select substring_index("aaa.bbb.ccc.ddd.eee",'.',-18446744073709551613);
    59  substring_index(aaa.bbb.ccc.ddd.eee, ., -18446744073709551613)
    60  aaa.bbb.ccc.ddd.eee
    61  select substring_index(null, 'abc', 9223372036854775808);
    62  substring_index(null, abc, 9223372036854775808)
    63  null
    64  select substring_index('xyz', null, 9223372036854775808);
    65  substring_index(xyz, null, 9223372036854775808)
    66  null
    67  select substring_index('xyz', 'abc', null);
    68  substring_index(xyz, abc, null)
    69  null
    70  SELECT SUBSTRING_INDEX('192,168,8,203', ',', 1);
    71  substring_index(192,168,8,203, ,, 1)
    72  192
    73  SELECT SUBSTRING_INDEX('192,168,8,203', ',', -1);
    74  substring_index(192,168,8,203, ,, -1)
    75  203
    76  SELECT SUBSTRING_INDEX(SUBSTRING_INDEX('192,168,8,203', ',', 2), ',',-1);
    77  substring_index(substring_index(192,168,8,203, ,, 2), ,, -1)
    78  168
    79  SELECT SUBSTRING_INDEX(SUBSTRING_INDEX('192,168,8,203', ',', -2), ',',1);
    80  substring_index(substring_index(192,168,8,203, ,, -2), ,, 1)
    81  8
    82  create table test(a varchar(100), b varchar(20), c int);
    83  insert into test values('www.mysql.com', '.', 0);
    84  insert into test values('www.mysql.com', '.', 1);
    85  insert into test values('www.mysql.com', '.', 2);
    86  insert into test values('www.mysql.com', '.', 3);
    87  insert into test values('www.mysql.com', '.', 9223372036854775808);
    88  Data truncation: data out of range: data type int32, value '9223372036854775808'
    89  insert into test values('www.mysql.com', '.', -1);
    90  insert into test values('www.mysql.com', '.', -2);
    91  insert into test values('www.mysql.com', '.', -3);
    92  select SUBSTRING_INDEX(a, b, c) from test;
    93  substring_index(a, b, c)
    94  
    95  www
    96  www.mysql
    97  www.mysql.com
    98  com
    99  mysql.com
   100  www.mysql.com
   101  drop table test;
   102  create table test(a varchar(100), b varchar(20), c float);
   103  insert into test values('www.mysql.com', '.', 0);
   104  insert into test values('www.mysql.com', '.', 1.0);
   105  insert into test values('www.mysql.com', '.', 2.0);
   106  insert into test values('www.mysql.com', '.', 3.0);
   107  insert into test values('www.mysql.com', '.', 92233720368547758.0);
   108  insert into test values('www.mysql.com', '.', -1.0);
   109  insert into test values('www.mysql.com', '.', -2.0);
   110  insert into test values('www.mysql.com', '.', -3.0);
   111  select SUBSTRING_INDEX(a, b, c) from test;
   112  substring_index(a, b, c)
   113  
   114  www
   115  www.mysql
   116  www.mysql.com
   117  www.mysql.com
   118  com
   119  mysql.com
   120  www.mysql.com
   121  drop table test;
   122  create table test(a varchar(100), b varchar(20), c varchar(100));
   123  insert into test values('www.mysql.com', '.', '0');
   124  insert into test values('www.mysql.com', '.', '1');
   125  insert into test values('www.mysql.com', '.', '2');
   126  insert into test values('www.mysql.com', '.', '3');
   127  insert into test values('www.mysql.com', '.', '-1');
   128  insert into test values('www.mysql.com', '.', '-2');
   129  insert into test values('www.mysql.com', '.', '-3');
   130  select SUBSTRING_INDEX(a, b, c) from test;
   131  substring_index(a, b, c)
   132  
   133  www
   134  www.mysql
   135  www.mysql.com
   136  com
   137  mysql.com
   138  www.mysql.com
   139  drop table test;
   140  create table test(a text, b varchar(20), c int);
   141  insert into test values('www.mysql.com', '.', 0);
   142  insert into test values('www.mysql.com', '.', 1);
   143  insert into test values('www.mysql.com', '.', 2);
   144  insert into test values('www.mysql.com', '.', 3);
   145  insert into test values('www.mysql.com', '.', 9223372036854775808);
   146  Data truncation: data out of range: data type int32, value '9223372036854775808'
   147  insert into test values('www.mysql.com', '.', -1);
   148  insert into test values('www.mysql.com', '.', -2);
   149  insert into test values('www.mysql.com', '.', -3);
   150  select SUBSTRING_INDEX(a, b, c) from test;
   151  substring_index(a, b, c)
   152  
   153  www
   154  www.mysql
   155  www.mysql.com
   156  com
   157  mysql.com
   158  www.mysql.com
   159  drop table test;
   160  create table test(a blob, b varchar(20), c int);
   161  insert into test values('www.mysql.com', '.', 0);
   162  insert into test values('www.mysql.com', '.', 1);
   163  insert into test values('www.mysql.com', '.', 2);
   164  insert into test values('www.mysql.com', '.', 3);
   165  insert into test values('www.mysql.com', '.', 9223372036854775808);
   166  Data truncation: data out of range: data type int32, value '9223372036854775808'
   167  insert into test values('www.mysql.com', '.', -1);
   168  insert into test values('www.mysql.com', '.', -2);
   169  insert into test values('www.mysql.com', '.', -3);
   170  select SUBSTRING_INDEX(a, b, c) from test;
   171  substring_index(a, b, c)
   172  
   173  www
   174  www.mysql
   175  www.mysql.com
   176  com
   177  mysql.com
   178  www.mysql.com
   179  drop table test;