v.19.3New Features
Added Function Tostartofinterval
Added function toStartOfInterval. #4304 (Vitaly Baranov)Why it matters
This feature solves the problem of aligning timestamps or dates to uniform intervals, simplifying time-based grouping, aggregation, and analysis in time-series data. It provides a convenient way to normalize datetime values to the start boundary of customizable intervals.How to use it
Use thetoStartOfInterval function by passing a datetime or date value along with an interval specification to round the datetime down to the nearest interval start. For example:SELECT toStartOfInterval(datetime_column, INTERVAL 15 minute) FROM table;