github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/function/func_math_power.test (about) 1 #SELECT, 嵌套 2 select power(exp(10), log(100)),exp(power(2,2)),power(-1,1),power(NULL,0),power(1,1),power(3,9),power(-1,2),power(NULL,2); 3 4 #SELECT 5 SELECT power(2,13); 6 SELECT power(-2,-3); 7 SELECT power(2,100); 8 SELECT power(10,100); 9 SELECT power(1,100); 10 11 #EXTREME VALUE, 科学计数法 12 select power(2,-1); 13 select power(-2,1); 14 select power(0.00000000000000001,123413); 15 select power(10e100,-39413312); 16 select power(0.141241241241313, 124314124124.12412341); 17 18 19 #NULL 20 select power(null,2); 21 select power(2, null); 22 select power(null,null); 23 24 #INSERT 25 CREATE TABLE t1(a DOUBLE); 26 INSERT INTO t1 select (power(56,124)); 27 INSERT INTO t1 select (power(10,100)); 28 INSERT INTO t1 select (power(2,234)); 29 SELECT * FROM t1 ORDER BY a; 30 drop table t1; 31 32 #DATATYPE 33 create table t1(a tinyint, b SMALLINT, c bigint, d INT, e BIGINT, f FLOAT, g DOUBLE, h decimal(38,19)); 34 insert into t1 values(1, 1, 2, 4, 5, 5.5, 31.13, 14.314); 35 select power(a,b),power(b,c),power(c,d),power(d,e),power(e,f),power(f,g),power(g,h) from t1; 36 drop table t1; 37 38 #算术操作 39 select power(123.54-123.03, 12-34); 40 select power(123.54*0.34, 1203-1200); 41 select power(134,34)-power(194,44); 42 43 44 #WHERE,distinct 45 drop table if exists t1; 46 create table t1(a float, b float); 47 insert into t1 values(10, 100), (2, 5); 48 select distinct * from t1 where power(a, b)>0; 49 drop table t1; 50 51 #ON CONDITION 52 create table t1(a INT, b int); 53 create table t2(a INT, b int); 54 insert into t1 values(2,4), (100,23); 55 insert into t2 values(10,100), (4,41); 56 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (power(t1.a, t1.b) <> power(t2.a, t2.b)); 57 drop table t1; 58 drop table t2; 59 60 61 #HAVING,比较操作 62 drop table if exists t1; 63 create table t1(a float, b float); 64 insert into t1 values(14.3, 4.413), (9.123, 9.409); 65 select b from t1 group by b having power(1,b)>0; 66 drop table t1; 67