ClickHouse数据库官方文档
数据库字段:
select code,any(value) as value,toStartOfInterval(`timestamp` ,INTERVAL 60 second) as timestamp,quality
from time_series_data tsd
where `timestamp` <('2022-07-22 19:30:00')
and `timestamp` >('2022-07-22 07:30:00')
and code='08000154'
group by code,timestamp,quality
order by timestamp;
second是秒的意思
结果: