ClickHouse/dbms/tests/queries/0_stateless/00704_arrayCumSumLimited_arrayDifference.sql

29 lines
685 B
MySQL
Raw Normal View History

2018-08-31 13:28:35 +00:00
DROP TABLE IF EXISTS test.test;
2018-09-03 10:52:44 +00:00
SELECT arrayCumSumNonNegative([1, 2, 3, 4]);
2018-08-31 13:28:35 +00:00
2018-09-03 10:52:44 +00:00
SELECT arrayCumSumNonNegative([1, -5, 5, -2]);
2018-08-31 13:28:35 +00:00
SELECT arrayDifference([1, 2, 3, 4]);
SELECT arrayDifference([1, 7, 100, 5]);
CREATE TABLE test.test(a Array(Int64), b Array(Float64), c Array(UInt64)) ENGINE=Memory;
INSERT INTO test.test VALUES ([1, -3, 0, 1], [1.0, 0.4, -0.1], [1, 3, 1]);
2018-09-03 10:52:44 +00:00
SELECT arrayCumSumNonNegative(a) FROM test.test;
2018-08-31 13:28:35 +00:00
2018-09-03 10:52:44 +00:00
SELECT arrayCumSumNonNegative(b) FROM test.test;
2018-08-31 13:28:35 +00:00
2018-09-03 10:52:44 +00:00
SELECT arrayCumSumNonNegative(c) FROM test.test;
2018-08-31 13:28:35 +00:00
SELECT arrayDifference(a) FROM test.test;
SELECT arrayDifference(b) FROM test.test;
SELECT arrayDifference(c) FROM test.test;
DROP TABLE IF EXISTS test.test;