ClickHouse/tests/queries/0_stateless/00805_round_down.sql

20 lines
1.2 KiB
MySQL
Raw Normal View History

2018-12-19 01:30:32 +00:00
SELECT number as x, roundDown(x, [0, 1, 2, 3, 4, 5]) FROM system.numbers LIMIT 10;
SELECT toUInt8(number) as x, roundDown(x, [-1.5, e(), pi(), 5.5]) FROM system.numbers LIMIT 10;
SELECT toInt32(number) as x, roundDown(x, [e(), pi(), pi(), e()]) FROM system.numbers LIMIT 10;
SELECT number as x, roundDown(x, [6, 5, 4]) FROM system.numbers LIMIT 10;
SELECT 1 as x, roundDown(x, [6, 5, 4]);
2020-06-20 11:29:01 +00:00
SET send_logs_level = 'fatal';
2018-12-19 01:30:32 +00:00
SELECT 1 as x, roundDown(x, []); -- { serverError 43 }
SELECT 1 as x, roundDown(x, emptyArrayUInt8()); -- { serverError 44 }
2018-12-19 02:43:09 +00:00
SELECT roundDown(number, [number]) FROM system.numbers LIMIT 10; -- { serverError 44 }
2018-12-19 01:30:32 +00:00
SELECT 1 as x, roundDown(x, [1]);
SELECT 1 as x, roundDown(x, [1.5]);
SELECT number % 10 as x, roundDown(x, (SELECT groupArray(number * 1.25) FROM numbers(100000))) FROM system.numbers LIMIT 10;
2018-12-19 02:11:31 +00:00
SELECT toDecimal64(number, 5) / 100 as x, roundDown(x, [4, 5, 6]) FROM system.numbers LIMIT 10;
2018-12-19 02:43:09 +00:00
SELECT toDecimal64(number, 5) / 100 as x, roundDown(x, [toDecimal64(0.04, 5), toDecimal64(0.05, 5), toDecimal64(0.06, 5)]) FROM system.numbers LIMIT 10;
SELECT toDecimal64(number, 5) / 100 as x, roundDown(x, [toDecimal32(0.04, 2), toDecimal32(0.05, 2), toDecimal32(0.06, 2)]) FROM system.numbers LIMIT 10;