2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS decimal;
|
2018-08-30 11:17:02 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS decimal
|
2018-08-30 11:17:02 +00:00
|
|
|
(
|
|
|
|
a DEC(9, 3),
|
|
|
|
b DEC(18, 9),
|
|
|
|
c DEC(38, 18)
|
|
|
|
) ENGINE = Memory;
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) VALUES (42.0, -42.0, 42) (0.42, -0.42, .42) (42.42, -42.42, 42.42);
|
|
|
|
INSERT INTO decimal (a, b, c) FORMAT JSONEachRow {"a":1.1, "b":-1.1, "c":1.1} {"a":1.0, "b":-1.0, "c":1} {"a":0.1, "b":-0.1, "c":.1};
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT CSV 2.0,-2.0,2
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT CSV 0.2 ,-0.2 ,.2
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT CSV 2.2 , -2.2 , 2.2
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT TabSeparated 3.3 -3.3 3.3
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT TabSeparated 3.0 -3.0 3
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT TabSeparated 0.3 -0.3 .3
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT CSV 4.4E+5,-4E+8,.4E+20
|
2024-07-25 17:40:37 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO decimal (a, b, c) FORMAT CSV 5.5e-2, -5e-9 ,.5e-17
|
2018-08-30 11:17:02 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT * FROM decimal ORDER BY a FORMAT JSONEachRow;
|
|
|
|
SELECT * FROM decimal ORDER BY b DESC FORMAT CSV;
|
|
|
|
SELECT * FROM decimal ORDER BY c FORMAT TabSeparated;
|
2018-08-30 11:17:02 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS decimal;
|