github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_upper_lower.sql (about)

     1  -- test function to_upper
     2  select to_upper('abc'), upper('abc');
     3  select to_upper('abc 123'), upper('abc 123');
     4  select to_upper(null);
     5  
     6  create table up_t(a varchar(10), b char(10));
     7  insert into up_t values('abc', 'abc');
     8  insert into up_t values(null, null);
     9  insert into up_t values('abc 123', 'abc 123');
    10  select to_upper(a), upper(a) from up_t;
    11  select to_upper(b), upper(b) from up_t;
    12  
    13  
    14  -- test function to_lower
    15  select to_lower('ABC'), lower('ABC');
    16  select to_lower('AbC 123'), lower('AbC 123');
    17  select to_lower(null);
    18  
    19  create table low_t(a varchar(10), b char(10));
    20  insert into low_t values('ABC', 'ABC');
    21  insert into low_t values(null, null);
    22  insert into low_t values('AbC 123', 'AbC 123');
    23  select to_lower(a), lower(a) from low_t;
    24  select to_lower(b), lower(b) from low_t;
    25  
    26  
    27  -- to_upper nested with string function
    28  select to_upper(ltrim('   ueenjfwabc123'));
    29  select upper(rtrim('  3782dfw23123123123   '));
    30  select to_upper(trim('  32431 %^ 3829  3huicn2432g23   '));
    31  select upper(substring('21214avewwe12',3,20));
    32  select upper(reverse('sjkdakjevenjwvev')) as result;
    33  
    34  
    35  -- to_lower nested with string function
    36  select lower(ltrim('   uEENjfwabc123'));
    37  select to_lower(rtrim('  3782dfWWWW23123123123   '));
    38  select lower(trim('  32431 %^ 3829  3huICN2432g23   '));
    39  select to_lower(substring('21214AewWE12',3,20));
    40  select lower(reverse('sjkDAKjeveBJwvev')) as result;
    41