mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 05:52:05 +00:00
20 lines
333 B
SQL
20 lines
333 B
SQL
SELECT
|
|
number,
|
|
sum(number)
|
|
FROM numbers(10)
|
|
WHERE number % 3 = 1
|
|
GROUP BY number
|
|
WITH TOTALS
|
|
ORDER BY number DESC WITH FILL FROM 15;
|
|
|
|
SET enable_positional_arguments = 0;
|
|
|
|
SELECT
|
|
number,
|
|
sum(number)
|
|
FROM numbers(10)
|
|
WHERE number % 3 = 1
|
|
GROUP BY number
|
|
WITH TOTALS
|
|
ORDER BY 10, number DESC WITH FILL FROM 15;
|