mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
12 lines
283 B
SQL
12 lines
283 B
SQL
SELECT
|
|
sum(c),
|
|
toInt32((h - null::Nullable(DateTime)) / 3600) + 1 AS a
|
|
FROM
|
|
(
|
|
SELECT count() AS c, h
|
|
FROM ( SELECT now() AS h )
|
|
WHERE toInt32((h - null::Nullable(DateTime)) / 3600) + 1 = 1
|
|
GROUP BY h
|
|
)
|
|
GROUP BY a settings min_count_to_compile_expression = 0;
|