github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_string_bin.result (about) 1 select bin(0b11111111); 2 bin(0b11111111) 3 11111111 4 select bin(12); 5 bin(12) 6 1100 7 SELECT bin(1314); 8 bin(1314) 9 10100100010 10 select bin(2e5); 11 bin(2e5) 12 110000110101000000 13 SELECT bin(null); 14 bin(null) 15 NULL 16 SELECT concat_ws(",", bin(1000), bin(2000)); 17 concat_ws(,, bin(1000), bin(2000)) 18 1111101000,11111010000 19 select bin(0); 20 bin(0) 21 0 22 select bin(-1); 23 bin(-1) 24 1111111111111111111111111111111111111111111111111111111111111111 25 select bin(10e50); 26 invalid input: The input value is out of range 27 select bin(-10e50); 28 invalid input: The input value is out of range 29 select bin(0.00000000000000000000000001); 30 bin(0.00000000000000000000000001) 31 0 32 select bin(-0.00000000000000000000000001); 33 bin(-0.00000000000000000000000001) 34 0 35 select bin("你好"); 36 invalid argument cast to int, bad value 你好 37 create table t1(a int); 38 insert into t1 values(); 39 select bin(a) from t1; 40 bin(a) 41 NULL 42 drop table t1; 43 CREATE TABLE t1(a char(255), b varchar(255)); 44 INSERT INTO t1 select bin(56), bin(234); 45 INSERT INTO t1 select bin(100), bin(234); 46 SELECT distinct bin(a), bin(b) FROM t1 ORDER BY bin(a); 47 bin(a) bin(b) 48 100001100100101000100 101010010110001101010010 49 11011000110011000 101010010110001101010010 50 drop table t1; 51 CREATE TABLE t1 (a int); 52 INSERT INTO t1 VALUES (100), (12); 53 SELECT a FROM t1 54 GROUP BY a 55 HAVING bin(a) <>0; 56 a 57 100 58 12 59 DROP TABLE t1; 60 drop table if exists t1; 61 CREATE TABLE t1 (a int); 62 CREATE TABLE t2 (a int); 63 INSERT INTO t1 VALUES (100), (200), (300), (10); 64 INSERT INTO t2 VALUES (100), (50), (20), (10), (300); 65 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (bin(t1.a) = bin(t2.a)); 66 a a 67 100 100 68 10 10 69 300 300 70 drop table t1; 71 drop table t2;