1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-27 08:21:15 +03:00
Files
mariadb-columnstore-engine/mtr/basic/r/mcs239_format_function.result
mariadb-RomanNavrotskiy 73b4147cf3 move mtr suites here
2021-01-31 01:38:31 +02:00

32 lines
758 B
Plaintext

DROP DATABASE IF EXISTS mcs239_db;
CREATE DATABASE mcs239_db;
USE mcs239_db;
CREATE TABLE t1 (a INT, b DECIMAL(10,5))ENGINE=Columnstore;
INSERT INTO t1 VALUES (1, 12.0623), (2, -0.1712), (3, 3.3851);
SELECT a, FORMAT(a, 2) FROM t1 ORDER BY 1;
a FORMAT(a, 2)
1 1.00
2 2.00
3 3.00
SELECT a*0.06, FORMAT(a*0.06, 2) FROM t1 ORDER BY 1;
a*0.06 FORMAT(a*0.06, 2)
0.06 0.06
0.12 0.12
0.18 0.18
SELECT b, FORMAT(b, 2) FROM t1 ORDER BY 1;
b FORMAT(b, 2)
-0.17120 -0.17
3.38510 3.39
12.06230 12.06
SELECT b, FORMAT(b, 6) FROM t1 ORDER BY 1;
b FORMAT(b, 6)
-0.17120 -0.171200
3.38510 3.385100
12.06230 12.062300
SELECT b*0.2, FORMAT(b*0.2, 7) FROM t1 ORDER BY 1;
b*0.2 FORMAT(b*0.2, 7)
-0.034240 -.0342400
0.677020 0.6770200
2.412460 2.4124600
DROP DATABASE mcs239_db;