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