ClickHouse/tests/queries/0_stateless/00498_bitwise_aggregate_functions.sql
2023-05-04 16:05:10 +08:00

4 lines
535 B
SQL

SELECT number % 4 AS k, groupArray(number), groupBitOr(number), groupBitAnd(number), groupBitXor(number) FROM (SELECT * FROM system.numbers LIMIT 20) GROUP BY k ORDER BY k;
SELECT number % 4 AS k, groupArray(-number), groupBitOr(-number), groupBitAnd(-number), groupBitXor(-number) FROM (SELECT * FROM system.numbers LIMIT 20) GROUP BY k ORDER BY k;
SELECT number % 4 AS k, groupArray(number-10), groupBitOr(number-10), groupBitAnd(number-10), groupBitXor(number-10) FROM (SELECT * FROM system.numbers LIMIT 20) GROUP BY k ORDER BY k;