mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
17 lines
481 B
SQL
17 lines
481 B
SQL
-- https://github.com/ClickHouse/ClickHouse/issues/11068
|
|
SET enable_analyzer=1;
|
|
create table vt(datetime_value DateTime, value Float64) Engine=Memory;
|
|
|
|
create view computed_datum_hours as
|
|
SELECT
|
|
toStartOfHour(b.datetime_value) AS datetime_desc,
|
|
sum(b.value) AS value
|
|
FROM vt AS b
|
|
GROUP BY toStartOfHour(b.datetime_value);
|
|
|
|
SELECT
|
|
toStartOfHour(b.datetime_value) AS datetime_desc,
|
|
sum(b.value) AS value
|
|
FROM vt AS b
|
|
GROUP BY toStartOfHour(b.datetime_value);
|