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

     1  select abs(-10);
     2  abs(-10)
     3  10
     4  select abs(-2) * -2;
     5  abs(-2) * -2
     6  -4
     7  select abs(1e10);
     8  abs(1e10)
     9  1.0E10
    10  select abs(NULL);
    11  abs(NULL)
    12  null
    13  select abs(9999999999999999999999);
    14  abs(9999999999999999999999)
    15  9999999999999999999999
    16  select abs(-9999999999999999999999);
    17  abs(-9999999999999999999999)
    18  9999999999999999999999
    19  select abs(10/0);
    20  Data truncation: division by zero
    21  select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2);
    22  Data truncation: data out of range: data type uint64, value '-2'
    23  CREATE TABLE t(u TINYINT UNSIGNED NOT NULL);
    24  INSERT INTO t VALUES (0), (3), (255);
    25  SELECT * FROM t WHERE ABS(u=256)=0;
    26  invalid argument function abs, bad value [BOOL]
    27  DROP TABLE t;
    28  create table t1(a int, b int, c int);
    29  insert into t1 values(100,1,2),(200,1,1),(300,2,1),(400,2,2);
    30  select distinct b from t1 order by abs(b);
    31  SQL syntax error: for SELECT DISTINCT, ORDER BY expressions must appear in select list
    32  select distinct b as z from t1 order by abs(z);
    33  SQL syntax error: for SELECT DISTINCT, ORDER BY expressions must appear in select list
    34  select distinct abs(b) as z from t1 order by z;
    35  z
    36  1
    37  2
    38  select distinct abs(b) as z from t1 order by abs(b);
    39  z
    40  1
    41  2
    42  select distinct abs(b) from t1 order by abs(b);
    43  abs(b)
    44  1
    45  2
    46  drop table t1;
    47  CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
    48  INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1);
    49  SELECT CASE any_value(c1) WHEN any_value(c1) + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
    50  CASE any_value(c1) WHEN any_value(c1) + 1 THEN 1 END	ABS(AVG(c0))
    51  null	1.0000
    52  DROP TABLE t1;
    53  CREATE TABLE t(i INT);
    54  INSERT INTO t VALUES (-1),(2),(1);
    55  SELECT ABS(i) AS a FROM t GROUP BY abs(i) ORDER BY a + 1;
    56  a
    57  1
    58  2
    59  SELECT ABS(i) AS a FROM t GROUP BY a ORDER BY a + 1;
    60  a
    61  1
    62  2
    63  DROP TABLE t;
    64  CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
    65  CREATE TABLE t2(c0 INTEGER, c1 INTEGER, c2 INTEGER);
    66  INSERT INTO t1 select abs(-341.741), abs(-234141113), abs(-141241);
    67  INSERT INTO t2 select abs(-341.5612), abs(-23413), abs(-14141);
    68  select * from t1;
    69  c0	c1	c2
    70  342	234141113	141241
    71  select * from t2;
    72  c0	c1	c2
    73  342	23413	14141
    74  SELECT t1.c0, t2.c0 from t1 join t2 on abs(t1.c0) = abs(t2.c0) having abs(t1.c0)>100;
    75  SQL syntax error: column "t1.c0" must appear in the GROUP BY clause or be used in an aggregate function
    76  drop table t1;
    77  drop table t2;
    78  SELECT abs(10)-abs(-34);
    79  abs(10)-abs(-34)
    80  -24
    81  SELECT abs(1241)*abs(-0.4141);
    82  abs(1241)*abs(-0.4141)
    83  513.8981
    84  SELECT abs(-100)>abs(-102);
    85  abs(-100)>abs(-102)
    86  false
    87  SELECT abs(-100)<>abs(100);
    88  abs(-100)<>abs(100)
    89  false